Cryptographically secure DRNG for pure js? - javascript

I am looking for a DRNG/DRBG/CSPRNG (cryptographically secure) in js. My application is currently using the web crypto api, and I am looking to use a DRNG to generate multiple, identical AES keys (using the web crypto deriveKey() function) on separate client devices, sharing the seed securely. I know there are several HMAC_DRBG libraries for node js, but I am looking to use native js only (or some pure math function which I can convert). Any suggestions are greatly appreciated!

Related

Face lock using JavaScript without using any third-party frameworks including TensorFlow.js

Whenever I'm working on any web project, I always want to develop everything on my own without using any third-party framewoks or libraries. I had actually designed password based authentication using sessions. Now I would like to implement face authentication. How can I do that?
How can I train my JS detecting user face? What is the logic behind this? I don't want to use any third-party framewoks or libraries even from trusted companies. For instance, if a third-party JavaScript framework can help us in doing this, then why can't we do that? Even that framework is also coded in JavaScript right?
It is possible in many ways, using C++ libraries, Tensorflow, Tensorflow Lite, Tensorflow JS, and authenticating process as your intention. Communication is a single point target with the response of information and targets. ( JS is simply https://js.tensorflow.org/api/latest/ )
Face recognition is easy you can do it without API but with API they can adjust easily and have those parameters interfaces. I simply an example this codes many times but it is working when the face recognition is possible with Tensorflow and Python. The exchange parameters are only authentication and your camera access with return some parameter told you to do next process or with messages errors return.

Use Java Library in Javascript

I am planning a project where I will develop bots for Agar.io by using the NEAT algorithm, which is implemented in Java (this is called ANJI). I will use the open-source Agar.io server called Ogar, which is implemented in Javascript. The Javascript implementation should communicate with the Java library to evolve the bots while the game is running, but I have no previous experience of how to make Java and Javascript communicate. I have considered using Rhino, but it does not seem like it is possible to use in a browser. So, are there any way to let a Javascript implementation like Ogar use a Java library?
using the Rhino / Nashorm is not relevant in this case and as for performance focus its should be much hard to run nodeJS based application via Java JS engine.
the Agar.io server is a NodeJS server that expose a WebSocket API and the client solution need to communicate this way.
Using spring websocket client for example
have you seen Agar.io-bot ? its seems like the way they implement the BOT is javascript browser extension and communicate via the browser.
In common, Javascript and Java library communicate using Rest and Json, Java provide Rest API and Javascript send Json request to this API.
This is list of java library: for developing Java Rest API and working with JSON. I recommend using RESTEasy.

Socket.io/Node.js & SCTP?

I am developing an web application that will use web sockets to dynamically update the website for the user. The idea is to have changes in the back-end engine be dynamically transmitted. In order to do that, I want to use a Node.js server as a link between the web browser and back-end engine. Unfortunately, Node.js/JavaScript does not support SCTP sockets, which is what the back-end engine is using. Can you think of any way around this? It would be a shame if I couldn't use Socket.io and would have to deploy my own Javascript plugin & Java websocket server.
You can write the SCTP part in C or C++ and then write an addon to make it available in Node.js. I am currently trying that for one of my projects using SCTP.
Of cource, this is not super elegant, not very portable and it is some extra work, but if you really want to use Node.js, this is one of the possible ways...

Rich web application (HTML5 +JS) with Java on the backend?

There are lots of great Javascript libraries out there these days for creating rich web applications and I would like to use one of them for the frontend of a website I'm working on as they seem to provide a way better interface than what you usually see with JSF, Facelets, PrimeFaces, etc...I read so many complaints about the presentation layer for Java EE and on the other hand things seem to be getting better and better when it comes to Javascript and HTML5.
I am wondering how to go about doing this? One JSP and Facelets you can have items in the presentation layer directly mapped to objects on the server. How would you deal with this when instead you use a Javacript library for your frontend?
I will use Java EE on the server but what is the best way of integrating this with a Javascript RIA library on the frontend?
If your question is only about mapping objects from the back-end to the JavaScript front-end, then I suggest using a JAX-RS implementation (RESTEasy, Restlet, Apache CXF, ...) in combination with Jackson (JSON provider).
This combination allows you to publish a REST API with your domain objects converted to JSON, so you can easily access these objects through JavaScript by using AJAX requests.
But of course this leaves a lot of communication handling open to the developer, if you want to have a more complete package, frameworks like Google Web Toolkit are probably a better solution.
A Google Web Toolkit frontend would be easiest to combine with a Java EE backend as it supports this out of the box with it's own communication system. Otherwise RESTful services are easy to communicate with from javascript and are easy to create in Java EE especially with the aid of an IDE like netbeans.
You can create a front end using JavaScript Libraries like JQuery, ExtJS, Dojo etc with HTML/ HTML5.
To communicate with a Java EE server, you can use an Ajax request with the response in xml/json format.

How to pass data from C++ application to Javascript

I'm developing a jQuery-based pivot table.
The goal is not a web app but a desktop-based application (C++). In my idea, data is retrieved by the application from the database, then passed to a html page and then showed through the pivot-table plugin.
There is no web server and the web page containing the plugin cannot access to the database.
So, how to pass data in an efficient way? I've seen other questions here on SO around this matter, but I think we're in a different scenario. Of course I can write the data in a txt/xml/js file, but I've experienced that for huge amounts of data, writing down files is costing a lot.
If you don't want to add support for the http protocol to your application, and you don't want to write to additional files, then IMO your best bet is to create a wrapping http server for your application. Then the javascript page can access the running wrapper which can talk to your "real" application.
You could create such a server relatively easily in python using the twisted framework, ruby using rails and the bundled webrick server, or the v8 Javascript engine node.js. (I'm sure there's dozens of other options out there too)
Which of there would be best for you will depend a lot on which languages you have experience with and what your deployment requirements are (supported OSes, existing installed applications, installation size, license terms on your software etc.)
Do you have a specific framework for your desktop app ? If you use Qt for the GUI, you can also integrate javascript quite easily.
http://efforts.embedded.ufcg.edu.br/qt/?p=84
You might be able to use named pipes to pass data to a static page.
It might also be better to just make your c++ program into a simple web server which opens a port, and have it generate the web page when the user goes to http://localhost:8080.

Categories

Resources