There are two articles worth looking at:
https://blog.csdn.net/wgw335363240/article/details/8878584
Conclusion:
1 AES encryption time and the size of the encrypted file is growing linearly, encrypting 1G of the file will take about 4 minutes, encryption speed is still very fast
2 The encrypted file size is twice times the size of the original file
3 The time required to decrypt the file is twice times the encryption time (this should be encrypted file is the original file size twice times the result)
https://blog.csdn.net/woshiaotian/article/details/46990899
Test environment:
CPU 1 Core Intel 2.2GHZ
Memory 1GB
Algorithm type
AES CBC mode based on symmetric encryption algorithm
Asymmetric Encryption Algorithm RSA 256
Encrypted plaintext length is 160 bytes
Run 10,000 times each
From Crypto.cipher import AES
import time
obj = aes.new (' A key123 ', AES. MODE_CBC, ' This is a IV456 '] message
= ' a ' * 160
T1 = time.time () to
I in Xrange (10000):
ciphertext = OB J.encrypt (message)
obj2 = Aes.new (' It is a key123 ', AES. MODE_CBC, ' is a IV456 ')
text = Obj2.decrypt (ciphertext)
#print text
t2 = time.time ()
print t2-t1
From Crypto.publickey import RSA
import time
t1 = time.time ()
key = Rsa.generate (2048)
t2 = Time.time () C4/>print ' Gen key ', t2-t1
#print key
#print key.exportkey ()
#print rsa.exportkey (' PEM ') message
= ' a ' * 160
T1 = time.time ()
for I-xrange (10000):
print i
ciphertext = key.encrypt (message, None)
Key.decrypt (ciphertext)
t2 = time.time ()
print t2-t1
Algorithm time consuming
Symmetric encryption Algorithm 0.13
Asymmetric Encryption Algorithm 193.16
Asymmetric encryption algorithm generates key pair 0.68
Symmetric encryption algorithm is about 1500 times times faster than an asymmetric encryption algorithm
RSA to generate a key requires 0.68 seconds, visible symmetric encryption algorithm than asymmetric encryption algorithm has a very large performance advantage.