Skip to content

Can Themis Decrypt Data Encrypted by another library with AES/GCM/NoPadding? #1049

Answered by G1gg1L3s
VolodymyrKryvonos asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, @VolodymyrKryvonos. Thanks for the question!

While it's true that Themis uses AES-GCM under the hood, it also uses custom KDF to derive the actual encryption key from the supplied key material (see here). This means that it is likely incompatible with your encryption scheme and it wouldn't be possible to apply Themis here.

Still, to avoid the need for migrating large amounts of data all at once, you can opt for a more gradual approach. When you select a record, check if it's encrypted with the old scheme, decrypt it and re-encrypt using Themis. This approach will require some form of ciphertext versioning, so you'll need to extend the database schema or prepend markers to Themis ciphe…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by VolodymyrKryvonos
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants