
Private_key_file.write(keys.exportKey(format='PEM', passphrase=self.private_key_passphrase)) With open(self.private_key_loc, 'wb') as private_key_file: Public_key_file.write(keys.publickey().exportKey(format='PEM', passphrase=self.public_key_passphrase))

With open(self.public_key_loc, 'wb') as public_key_file: Keys = RSA.generate(keys_size, random_generator) Self.private_key_passphrase = private_key_passphrase Self.public_key_passphrase = public_key_passphrase :param private_key_passphrase: Private key passphrase :param public_key_passphrase: Public key passphrase :param private_key_loc: Path to private key file :param public_key_loc: Path to public key file Public_key_passphrase=None, private_key_passphrase=None): Out_file.write(crypt_and_verify(chunk, tag))īlowfish cipher, 256-bit key, 64-bit blockĬipher = Blowfish.new(key=self.key, mode=Blowfish.MODE_EAX)Ĭipher = Blowfish.new(key=self.key, mode=Blowfish.MODE_EAX, nonce=nonce)ĭef _init_(self, public_key_loc=None, private_key_loc=None, Orig_size = struct.unpack(' How secure is this Python code? Can there be any attacks on this encryption? I tried to follow all the rules that I could find: KDF instead of hash, EAX (authenticated encryption mode) and other.