0

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) ?

3
  • 1
    Which encryption algorithm are you going to use? If you pick one that has both a C and a Python implementation, that's the straightforward way. Which algorithm do you think you want to use? Commented Feb 28, 2011 at 22:16
  • I think I will use symmetric encryption with AES Commented Feb 28, 2011 at 22:35
  • 2
    Please update your question to state that you plan to use AES. Then, please search using Google for AES implementations in Python and C. Then, please ask any specific questions on the implementations you found. Commented Feb 28, 2011 at 22:44

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.