encryption-asymmetric

Node.js correct way to make rsa encrypt?

╄→尐↘猪︶ㄣ 提交于 2021-02-07 09:44:56
问题 i'm trying to create a WS for make soap request. In the body of the message there is a field that contains an encrypted text. I have the public key to encrypt the text but the only result that i obtain is that the text is not recognized. I use crypto module of node for making request and the text is crypted but i don't know why is not correclty encrypted. Ps i made the same thing on php with openssl_public_encrypt function and working. But i have to do it in node.js. Any idea or suggestion?

Node.js correct way to make rsa encrypt?

爱⌒轻易说出口 提交于 2021-02-07 09:44:11
问题 i'm trying to create a WS for make soap request. In the body of the message there is a field that contains an encrypted text. I have the public key to encrypt the text but the only result that i obtain is that the text is not recognized. I use crypto module of node for making request and the text is crypted but i don't know why is not correclty encrypted. Ps i made the same thing on php with openssl_public_encrypt function and working. But i have to do it in node.js. Any idea or suggestion?

RSA encyrption - converting between bytes array and String [duplicate]

帅比萌擦擦* 提交于 2021-02-05 06:45:57
问题 This question already has answers here : IllegalBlockSizeException when trying to encrypt and decrypt a string with AES (4 answers) Closed 3 years ago . I am trying to implement RSA encryption which is able to do the following: accept a string value as an input to encrypt using a public key return the encrypted cipher as string accept the encrypted cipher as an input to decrypt using a private key return the original value, decrypted I am able to get the encryption/decryption working if I

Generate a public key with a predefined modulus and exponent (strange values)

一曲冷凌霜 提交于 2021-01-29 04:58:19
问题 "n": "rKZ-1zdz_CoLekSynOtyWv6cPSSkV28Kb9kZZHyYL-yhkKnH_bHl8OpWiGxQiKP0ulLRIaq1IhSMetkZ8FfXH-iptIDu4lPb8gt0HQYkjcy3HoaKRXBw2F8fJQO4jQ-ufR4l-E0HRqwLywzdtAImNWmju3A4kx8s0iSGHGSHyE4EUdh5WKt-NMtfUPfB5v9_2bC-w6wH7zAEsI5nscMXnvz1u8w7g2_agyhKSK0D9OkJ02w3I4xLMlrtKEv2naoBGerWckKcQ1kBYUh6WASPdvTqX4pcAJi7Tg6jwQXIP1aEq0JU8C0zE3d33kaMoCN3SenIxpRczRzUHpbZ-gk5PQ", "e": "AQAB", How can I generate a public key from these values? Preferable via python or Linux programs. I'm sorry if the question is nonsense

How to decrypt the message using private key -RSA algorithm in java

风格不统一 提交于 2020-12-15 06:53:41
问题 As I'm generating the encrypted string using .cer file but unable to do decryption. for decryption I have a file with .key extension and inside start with: -----BEGIN RSA PRIVATE KEY----- Algorithm: RSA/ECB/PKCS1Padding // encrypting session key using public key public static String encryptSessionKey_PublicKey(String data) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, CertificateException, FileNotFoundException {

How to decrypt the message using private key -RSA algorithm in java

送分小仙女□ 提交于 2020-12-15 06:52:15
问题 As I'm generating the encrypted string using .cer file but unable to do decryption. for decryption I have a file with .key extension and inside start with: -----BEGIN RSA PRIVATE KEY----- Algorithm: RSA/ECB/PKCS1Padding // encrypting session key using public key public static String encryptSessionKey_PublicKey(String data) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, CertificateException, FileNotFoundException {