0

how to encrypt one time password using the public key and again recover it by the private key of the user , i need to do it using python

3
  • 2
    Do you want to encrypt something using a one-time key or do you want to encrypt the one-time key itself? Please clarify. And if you mean an one-time pad you shouldn't have to use a complex encryption algo at all, just use XOR. See en.wikipedia.org/wiki/One-time_pad Commented Jun 23, 2009 at 9:50
  • You should provide more detail on you application. Crypto things tend to go bad unless you know the "big picture" when designing them. Solving basic task with a key-hole view often leads to brittle solutions. Commented Jun 23, 2009 at 11:15
  • i want to encrypt one time password itself using the public key of the user which i retrieve from the server and also want to decrypt it using private key of the same user .i need to do it in python. Commented Jun 23, 2009 at 11:29

2 Answers 2

4

You can use Python's encryption library called PyCrypto (www.pycrypto.org). Here's some overview of Public Key encryption using PyCrypto: http://www.dlitz.net/software/pycrypto/doc/#crypto-publickey-public-key-algorithms

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

Comments

0

Use an encryption library, for example pyopenssl, which looks more up-to-date then pycrypto.

pyopenssl is a rather thin wrapper around (a subset of) the OpenSSL library. With thin wrapper I mean that a lot of the object methods do nothing more than calling a corresponding function in the OpenSSL library.

Comments

Your Answer

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