I am writing a client / server based program, Server side is with Php and Client is with Python, and I need to make sure the transfer data is safe both way.
So, My question is
What encryption algorithm would be best for data transfer between Python and Php?
- I couldn’t use Https
- Need to decrypt/encrypt with key on both Python and Php
- I would’t need to have
sharedpublic key, key could be set in both Python and Php manually - Since I don’t know how to implement algorithm myself, examples on both language would be great.
- My data are not serious like banking site, but just want to encrypt to be safe on the wire from sniffing
I’ve tried to check this question but I couldn’t find suitable answer for me
Compatible encryption between C# and PHP, ColdFusion, Ruby, Python
Thanks in advance.
The answer is usually "it depends". If all you’re looking for is symmetric encryption of sufficient quantities of data you’ll probably want something like AES. There are however many ways in which you could use encryption that can turn out to be insecure in the end, which is why using https is a good idea since it’s a bit higher level and harder to get badly wrong. I am not a security researcher, but this is just going on general advice I’ve been given in regard to security.
Anyways, there’s a python library (edit: link removed, see comments) and you can apparently use mcrypt to handle encryption/decryption in PHP itself.