Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem to decrypt in NodeJs with crypto #306

Open
Paulo-Ferreira-SJ opened this issue Feb 20, 2024 · 1 comment
Open

Problem to decrypt in NodeJs with crypto #306

Paulo-Ferreira-SJ opened this issue Feb 20, 2024 · 1 comment

Comments

@Paulo-Ferreira-SJ
Copy link

Paulo-Ferreira-SJ commented Feb 20, 2024

Hello! I appreciate your services in making this lib available. I used this article (here) as a reference to encrypt with a public key on the frontend and decrypt with a private key on the backend with node. When decrypting, I'm getting a string containing binary and the string that should be decrypted. To get this result I had to change the padding to crypto.constants.RSA_NO_PADDING instead RSA_PKCS1_PADDING. I know this article was written from 4 years. Someone can help me?

result: �@z�C�T����/�<7c�q�~:p�D���I�Th��]y�� �G�H�Q��e���X�{���;|�Iط���J7d�h��
�R���h�ɹ�( �P�]O| ��7�>��x=A;P�X�'�F+LAWE����Qp�1X�]�̏}lЪ�-و�<�x+�8���YV�[�7�z�"�r_��%%h�H�mP�.F�G����Je쮓��F��<W%6���G��W�|�pk`˩�]1111111111111111

The final part of result is the correct decrypted string ('1111111111111111')

@nikbobo
Copy link

nikbobo commented Mar 3, 2024

Yes, I also have this problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants