![]() ![]() ![]() StringAsBuffer = cStringIO.StringIO(string)ĮxternKeyFilename="/home/borrajax/rsaKeys/server-key.pem" RetvalTmp.write(aesEncryptor.encrypt(chunk)) ![]() RsaEncryptedPassword = pkcs1Encryptor.encrypt(thisMessagePassword) Iv = ''.join(chr(random.randint(0, 0xFF)) for i in range(16))ĪesEncryptor = AES.new(thisMessagePassword, AES.MODE_CBC, iv) RsaKey= RSA.importKey(externKeyFile, passphrase="F00bAr") #Begin RSA Part to get a cypher that uses the server's public keyĮxternKeyFilename="/home/borrajax/rsaKeys/server-key.pub"ĮxternKeyFile = open(externKeyFilename, "r") What it does is encrypting the data with the symmetric AES system (which uses a random key generated "on-the-fly"), cyphers the password used for AES using the RSA/PKCS#1 system and puts it in the result to be sent: #!/usr/bin/python I have created a test Python file that works fine encrypting with only one RSA key. I've been playing around with RSA/PKCS and AES encription. In that case, the server also keeps the private (or the "whole" RSA key) and sends the client the public part of its key. Also, that client can ask the server to generate another RSA key (or key-pair) for it. ![]() I have a server that has its own RSA key (generated with the openssl command when said server is installed) and a client which can request the public part of the server's key. I was wondering if it's possible to do a double RSA/PKCS#1 encryption with P圜rypto. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |