Skip to content

Problem to decrypt in NodeJs with crypto #306

Open
@Paulo-Ferreira-SJ

Description

@Paulo-Ferreira-SJ

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')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions