JSCryptor icon indicating copy to clipboard operation
JSCryptor copied to clipboard

Error: Unsupported schema version 2

Open AzriDelta opened this issue 6 years ago • 7 comments

Hello.

When decrypting the string which is already in base64, I encountered this error.

Sample of my code:

var password = "password"; var encrypted_username = "AgG0hYmf7iEEEsZRb213DFX65Uoe7iiwwDG6VWsC3+WuFBknZRWWnSzyoUHZkAlOgA3G6s4pukD8R6s9ErWsypAGA2xQRrLwjXJ0YXtaaxkjog=="

var decrypted_username = RNCryptor.Decrypt(encrypted_username, password); console.log("Decrypted username:", decrypted_username.toString());

Even using Buffer is not working, and return the same error.

AzriDelta avatar Sep 29 '18 12:09 AzriDelta

Hi @AzriDelta, I only implemented version 3 and decided to wait for an issue like this, I think it's better to use version 3 but if you really need to work with version 2, please let me know and I will get some time to implement it.

chesstrian avatar Sep 29 '18 15:09 chesstrian

Yes, I really need to use version 2, as I encrypt my data on Android device using this library https://github.com/TGIO/RNCryptorNative

AzriDelta avatar Sep 30 '18 00:09 AzriDelta

The library you mention seems to support version 3, why do you want to stick to version 2?.

chesstrian avatar Oct 01 '18 15:10 chesstrian

My bad, the library does not support version 3, it's available in a PR: https://github.com/TGIO/RNCryptorNative/pull/13

I highly recommend using version 3 instead, let me know if this works for you, otherwise I will dedicate some time to version 2 for NodeJS.

chesstrian avatar Oct 01 '18 15:10 chesstrian

Hello @chesstrian. I have tried in the past 2 weeks impelementing the PR branch (https://github.com/hoanghiephui/RNCryptorNative) that supposedly manage to use version 3, but with no success (ran into an error that cannot be solved).

AzriDelta avatar Oct 19 '18 14:10 AzriDelta

@AzriDelta Did u managed to solve the issue or changed the library?

ravindragupta90 avatar Jan 30 '19 14:01 ravindragupta90

@ravindragupta90 no I did not manage to solve it. I changed to another library.

AzriDelta avatar Jan 30 '19 15:01 AzriDelta

Version 2 not implemented at the end, will be checking if version 4 of the algorithm can be implemented.

chesstrian avatar Feb 26 '23 21:02 chesstrian