0

I couldn't think of a great title for this, so I'll clear up what I'm asking.

To start off, I don't want to use node. I'm on unix and I'm trying some kind of RSA public/private key encryption, and I'm not able to display the encrypted text without window.btoa().

However, the window object isn't available on a .js file on my computer, being run through terminal with jsc rather than on a website. It must be run through terminal, as this is how I'm going to be running this script in a C++ program I'm writing.

So, are there any alternative libraries or any ways to use window.btoa() on a script being run through my terminal?

levaa
  • 65
  • 9
  • How is btoa related to RSA? – user202729 Apr 06 '18 at 07:47
  • I need it to decode the values returned by the libraries I'm using. Example; `var testv2 = encryptedString(test, "encrypted string", RSAAPP.PKCS1Padding, RSAAPP.RawEncoding); console.log(window.btoa(testv2)); ` test being an RSAKeyPair object – levaa Apr 06 '18 at 07:57
  • There are some hand-written functions [here](https://stackoverflow.com/questions/246801/how-can-you-encode-a-string-to-base64-in-javascript/247261). | This is unrelated to RSA. – user202729 Apr 06 '18 at 08:03
  • @user202729 I'll remove the tag. – levaa Apr 06 '18 at 08:04

0 Answers0