47ng/prisma-field-encryption

[Question] DES Support

ahmadabbas02 opened this issue · 3 comments

First of all sorry if this isn't the way to contact you, but couldn't find any other way.

I'm looking for guidance on how i can add DES support instead of AES, the main reason is because I want to use this library for my university project which wants us to only use DES, I would appreciate any help.

Thank you for the awesome library definitely looking forward to using it in the future :)

Looks like a good starting point would be the work started by @Vitu-77 in PR #23.

There may be more intricacies to provide a good ciphersuite swap, especially since DES is not in the Node.js crypto ciphersuite, so you'd have to rely on an external library.

May I point out to your university that DES is a (very much) outdated cipher? If you're stuck with it for whatever weird academic reason, you could at least apply three rounds per block to make Triple DES.

Edit: @Vitu-77 has published their fork of this library with the custom cipher option under prisma-custom-field-encryption

As for my project, yeah sadly i know that DES is outdated but for some reason they wanted us to use DES at the initial stage and later update to AES, i will check out the PR and library you linked, thank you very much appreciate the fast response hope you have a good day.

Take my advice and look into implementing XSalsa20-Poly1305 from libsodium (secretbox) once you're done with AES, that'll show them what a modern cipher is! 🙂

Good luck with your project!