JSCryptor
JSCryptor copied to clipboard
Error: Unsupported schema version 2
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.
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.
Yes, I really need to use version 2, as I encrypt my data on Android device using this library https://github.com/TGIO/RNCryptorNative
The library you mention seems to support version 3, why do you want to stick to version 2?.
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.
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 Did u managed to solve the issue or changed the library?
@ravindragupta90 no I did not manage to solve it. I changed to another library.
Version 2 not implemented at the end, will be checking if version 4 of the algorithm can be implemented.