Hello everyone!.
I have the following problem.
I have a private key in PEM format. Now, I need to encrypt a Hash Value using the RSA algorithm with this private key.
Any idea?
Thank you!
Encrypt with RSA algorithm
Moderator: Neosoft Support
Encrypt with RSA algorithm
After the game, the nerd and the ignorant will return to the same box
-
- NeoSoft Team
- Posts: 5628
- Joined: Thu Mar 31, 2005 10:48 pm
- Location: Oregon, USA
- Contact:
Re: Encrypt with RSA algorithm
I have no idea if this will work, but I found the following VBScript code for RSA which you might be able to convert into a NeoBook function:
http://www.example-code.com/vbscript/rs ... trings.asp
Alternatively, here is an encryption/decryption plug-in for NeoBook called npCiph:
http://www.neosoftware.com/neobook/modu ... =8&lid=187
And a JavaScript encryption function:
http://www.neosoftware.com/neobook/modu ... 18&lid=242
http://www.example-code.com/vbscript/rs ... trings.asp
Alternatively, here is an encryption/decryption plug-in for NeoBook called npCiph:
http://www.neosoftware.com/neobook/modu ... =8&lid=187
And a JavaScript encryption function:
http://www.neosoftware.com/neobook/modu ... 18&lid=242
NeoSoft Support
Re: Encrypt with RSA algorithm
Thanks Dave.
I had already looked nCiph, but I think that unfortunately has no support for RSA. I need to find a function that allows me to encrypt a SHA1 hash using the RSA algorithm with a private key in PEM format (base64). That is, SHA1withRSA.
Or alternatively, separate functions that allow me to: (1) decode a Base64. (2) a function that allows me to encrypt using RSA.
Unfortunately I know little VBA, which is the language that could be used to design a NeoBook function. That's right I'm forced to learn.
I'm reviewing the links you sent me and others. If I find something I'll post. Meanwhile more ideas are welcome .
Thank you!
I had already looked nCiph, but I think that unfortunately has no support for RSA. I need to find a function that allows me to encrypt a SHA1 hash using the RSA algorithm with a private key in PEM format (base64). That is, SHA1withRSA.
Or alternatively, separate functions that allow me to: (1) decode a Base64. (2) a function that allows me to encrypt using RSA.
Unfortunately I know little VBA, which is the language that could be used to design a NeoBook function. That's right I'm forced to learn.
I'm reviewing the links you sent me and others. If I find something I'll post. Meanwhile more ideas are welcome .
Thank you!
After the game, the nerd and the ignorant will return to the same box
Re: Encrypt with RSA algorithm
I finally did it!. But I had to install OpenSSL.
I do not know if this code can serve someone. I leave it here anyway.
These are the parameters to encrypt a string (cadena.txt) using a private key in base64 (llaveprivada.pem). The encrypted result (timbre.txt).
Encryption: using "Sha1WithRsa":
And if you want the encrypted result (timbre.txt) expressed in Base64 (timbreBase64.txt) use this:
Anyway if anyone has a better idea, I welcome it.
Thanks.
I do not know if this code can serve someone. I leave it here anyway.
These are the parameters to encrypt a string (cadena.txt) using a private key in base64 (llaveprivada.pem). The encrypted result (timbre.txt).
Encryption: using "Sha1WithRsa":
Code: Select all
Run "C:\OpenSSL-Win32\bin\openssl.exe" "dgst -sha1 -sign E:/fe/llaveprivada.pem -out E:/fe/timbre.txt E:/fe/cadena.txt" "RunOnce+Wait" "" ""
Code: Select all
Run "C:\OpenSSL-Win32\bin\openssl.exe" "base64 -in E:/fe/timbre.txt -out E:/fe/timbreBase64.txt" "RunOnce+Wait" "" ""
Thanks.
After the game, the nerd and the ignorant will return to the same box
-
- NeoSoft Team
- Posts: 5628
- Joined: Thu Mar 31, 2005 10:48 pm
- Location: Oregon, USA
- Contact:
Re: Encrypt with RSA algorithm
I'm glad you found a solution, and thank you for sharing it with us!
NeoSoft Support