Reputation: 2798
I was wondering if there is any straightforward way to encrypt text or string in C so it can easily be decrypted in python using shared key encryption (AES) ?
Upvotes: 0
Views: 1487
Reputation: 6182
I would recommend calling GPG, the Gnu Privacy Gaurd in C via GPGME. You can read the data with Python using python-gnupg. This is the most secure option since you are relying on an open source, peer reviewed, and widely used cryptography implementation (GPG). There are many, many security pitfalls when implementing cryptography. In general, application developers should not implement cryptography themselves.
Upvotes: 2
Reputation: 80031
PyCrypto (not distributed as part of Python) implements algorithms like AES, and Mozilla Network Security Services provides C libraries to use encryption algorithms in C. Alternatively, there is OpenSSL, but its documentation is lacking.
I'd recommend a commonly used one like AES or Blowfish.
Upvotes: 1