How encrypt and decrypt files when uploading and downlowding files

0
Hello, I need more privacy in the project that i am working and i was trying to encrypt files when uploading it (such as a curriculum) and decrypt a file when downloadind it. I have tried with the module of encryption (https://docs.mendix.com/appstore/modules/encryption) but i haven´t achieved anything. If anyone can help me i would appreciate so much. Than you for your attention.
asked
5 answers
2

Hi Jagoba,

how did you set it up with this module and what didn't work? The module provides document encryption. 

In addition, you could after uploading the document parse it to base64 string and encrypt that string. When someone wants to download the file, decrypt the string and parse to document.

answered
1

I think the only option is to let the user provide the encryption key if you want to make it so that only the user can access this file. This means that the user will have to enter a password anytime he wants to upload or download a file. You could create a non-persistent-entity, let user enter his ‘passphrase’ and use the encrypt function from the encryption module a base64 string. You will risk that your users forget their key, which you generally don't want because there is no way to retrieve that key

Like the others said, otherwise the application will store the key, and this key is always visible to developers/admins.

answered
0

Hi Roy,

I am trying to ecrypt documents when uploading to the database and decrypt them when I want to download it, i do this because of privacy. For example, a user can upload his curriculum but the file must be encrypted, and when the responsible wants to download it the file must be decrypted. 

I try  using the microflows encrypt_document and decrypt_document but i haven`t achieved anything, can you explain me shortly how to use that microflows ?

Thank you for your attention,

Jagoba.

answered
0

Just keep in mind that encrypting a file with a key that is controlled by the application does absolutely nothing to increase user privacy. 

answered
0

Hi Jagoba,

in the encryption module there's a page named "CertificateManagement”. Here you need to create a certificate. When this is set, you can use the encrypt and decrypt document microflows. 

 

EDIT:

Like the others mentioned, it would be safest to let the user give the encryptionKey when uploading the document. Use this key to encrypt the file, when the user wants to download it, he/she will need to enter the same key in order to decrypt

answered