Services Plugins FAQs

Decrypt values on AES standard

Hi All,

In one of our apps we are using the plugin “Encode Decode Encrypt Decrypt” (Encode Decode Encrypt Decrypt Plugin | Bubble )

With this plugin we are encrypting some values in our application with the AES standard. When encrypting data based on an well-known standard i would assume that we should be able to decrypt these values using an external source which is based on the same AES standard. I was just testing to see if, using the encrypted values and secret key, i would be able to decrypt the values in an other online AES decryption tool. Up untill this moment i have not been able to decrypt the values without using this plugin.

Looking a some security i would like to be able to decrypt my values even if this plugin is phased out. Could anybody guide me on how this works and how i can decrypt these values with any other AES decryption tool?

Looking forward to your reply!

1 Like

Hi @fsmit,
Thank you for your message and for using the Encode/Decode/ Encrypt/Decrypt Plugin for Bubble.

I’ve verified with the dev team and they confirmed that this plugin was designed for encoding/decoding text by using different encryption/decryption methods.

I’m afraid your use case can’t be achieved.

It is generally not possible to search through encrypted text values by their original text in a database, including a Bubble database.

Encryption transforms the original text into a format that is unreadable and should not bear any resemblance to the original text. This is a fundamental property of strong encryption algorithms like AES. The process is designed to ensure that without the proper key, there is no feasible way to derive any information about the original text from the encrypted text.

If you have encrypted a piece of data with AES, you should indeed be able to decrypt it using any tool or library that implements AES, provided you have the correct key, and you are using the same encryption parameters.

However, there are several factors you need to ensure match between the encryption and decryption processes:

  1. Key: You must use the exact same key for decryption that was used for encryption.
  2. Cipher Mode: AES can operate in different modes, such as ECB (Electronic Codebook), CBC (Cipher Block Chaining), CFB (Cipher Feedback), OFB (Output Feedback), etc. You need to use the same mode for decryption that was used for encryption.
  3. Initialization Vector (IV): For modes like CBC, an Initialization Vector is used as an additional input along with the key. The IV does not need to be secret, but it should be random and unique for each encryption. If an IV was used during encryption, you need to use the same IV for decryption.
  4. Padding: AES operates on blocks of data, and the data to be encrypted needs to be a multiple of the block size. Padding is used to fill up the last block if the data is not a multiple of the block size. Common padding schemes include PKCS7, zero padding, etc. You need to use the same padding scheme for decryption that was used for encryption.
  5. Key Size: AES supports different key sizes, typically 128, 192, or 256 bits. You need to use the same key size for decryption that was used for encryption.
  6. Encoding: Before and after encryption, the data may be encoded in some way (e.g., base64, hex). You need to ensure that you are properly encoding and decoding your data at each step.

Hope this helps.
Let me know if you have other plugin-related questions.

Take care, :slight_smile:

Hi @Igor,

Thanks a lot for your quick and clear response, this really helps!

Would you be able to share the encryption processes used in this plugin on the 6 areas you have illustrated. The secret key is known so that one can be checked. Things like Cipher Mode, IV, Padding etc. is not documented on the plugin which makes it hard for me to copy that process.

Would love to get this sorted :smile:

Hi @fsmit,
Thank you for your reply.

The plugin uses CryptoJS v3.1.2 library.

Here you can find its documentation and more information about the encryption/decryption methods used.
https://code.google.com/archive/p/crypto-js/

Hope this helps.
Have a great weekend ahead.
Regards, :pray: