Sigmahokies Posted November 30, 2018 Share Posted November 30, 2018 (edited) Hello everyone, I'm trying to create a RSA encryption, but seem it is not function correctly. Is Javascript know RSA? like, let rsa = new RSA(); do I have to download from github? here my code: let rsa = new RSA(); let prime = ["2", "3", "5", "7", "11", "13"] //<-- Prime number let random = prime[Math.floor(Math.random() * prime.length)]; let text = document.getElementById("readed"); document.getElementById("en").innerHTML = rsa.encrypt(random, text); Seem console log show it is not function. Edited November 30, 2018 by Sigmahokies Link to comment Share on other sites More sharing options...
Ingolme Posted November 30, 2018 Share Posted November 30, 2018 RSA is not a native Javascript object, you will have to find a library. Wherever you found that code should have some documentation telling you where to get the library. Link to comment Share on other sites More sharing options...
Sigmahokies Posted November 30, 2018 Author Share Posted November 30, 2018 So, do I have to find source, then download it, then put in path to connect to this script? Link to comment Share on other sites More sharing options...
Ingolme Posted December 1, 2018 Share Posted December 1, 2018 You will need to include a script file on your page to use it, but you might not need to host it on your own server if they are offering a CDN. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now