pybitmessage.pyelliptic.cipher module¶
Symmetric Encryption
-
class
Cipher
(key, iv, do, ciphername='aes-256-cbc')[source]¶ Bases:
object
Main class for encryption
import pyelliptic iv = pyelliptic.Cipher.gen_IV(‘aes-256-cfb’) ctx = pyelliptic.Cipher(“secretkey”, iv, 1, ciphername=’aes-256-cfb’) ciphertext = ctx.update(‘test1’) ciphertext += ctx.update(‘test2’) ciphertext += ctx.final()
ctx2 = pyelliptic.Cipher(“secretkey”, iv, 0, ciphername=’aes-256-cfb’) print ctx2.ciphering(ciphertext)
-
static
get_all_cipher
()¶ static method, returns all ciphers available
-
static
get_blocksize
(ciphername)¶ This Method returns cipher blocksize
-
static
gen_IV
(ciphername)¶ Generate random initialization vector
-
update
(input)¶ Update result with more data
-
final
()¶ Returning the final value
-
ciphering
(input)¶ Do update and final in one method
-
static