Other [BANano]How to create Mysql compatible AES_Encrypt() & AES_Decrypt() functions

toby

Well-Known Member
Licensed User
Longtime User
I'm wondering how to implement them. By "compatible", I mean encrypted data by AES_Encrypt() can be decrypted with mysql's aes_decrypt() and AES_Decrypt() can be used to decrypt data encrypted by Mysql's aes_encrypt().

If someone who has the working code is willing to share, I would greatly appreciate it.

Thank you in advance for your help!
 

hatzisn

Well-Known Member
Licensed User
Longtime User
This is a B4J forum question. Until it is moved there by @Erel may I ask we do you need the Decrypt part in MySQL? It is just a storage and the B4J WebApp is the director of the whole party. You can just save it as a Base64 string (encrypted byte array -> Base64) and recall it from you B4J WebApp to decrypt it (Base64 -> byte array -> decrypt -> dectypted data strng).
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
Im not sure what you mean but there is something I looked at some time ago when sending data from a Banano app, then encrypt it and it's sent encrypted over the network and when it's received with mysql php is decrypted.

Yes whilst you can have https, and although this is not hacker or foolproof, it was a way to encrypt with aes and decrypt data both ways from Banano using Javascript and a php based encryption class.

The data is received by php, decrypted and then written to the database. I guess if you want to store it in encrypted format you can keep it like that. Is that what you mean?
 
Upvote 0
Top