Example #1
0
def encrypt_file(in_file_name, out_file_name, public_key, key_length=32):
    password = str(uuid.uuid4())
    print password
    encrypted_password = bitcoin_asymmetric_encrypt.encrypt(public_key,password)
    print encrypted_password
    with open(in_file_name, 'rb') as in_file, open(out_file_name, 'wb') as out_file:
        encrypt(in_file, out_file, password,encrypted_password)
Example #2
0
 def create_secure_payload(self, other_party_public_key_hex, message):
     other_party_public_key = CPubKey(
         other_party_public_key_hex.decode("hex"))
     encrypted = bitcoin_asymmetric_encrypt.encrypt(other_party_public_key,
                                                    message)
     signature = self.wallet.sign(encrypted)
     payload = {'signature': signature, 'message': encrypted}
     return payload
Example #3
0
 def create_secure_payload(self, other_party_public_key_hex, message):
     other_party_public_key = CPubKey(other_party_public_key_hex.decode("hex"))
     encrypted = bitcoin_asymmetric_encrypt.encrypt(other_party_public_key, message)
     signature = self.wallet.sign(encrypted)
     payload = {'signature': signature, 'message': encrypted}
     return payload