コード例 #1
0
 def _decrypt_rwcapdata(self, encwrcap):
     salt = encwrcap[:16]
     crypttext = encwrcap[16:-32]
     key = hashutil.mutable_rwcap_key_hash(salt, self._node.get_writekey())
     encryptor = aes.create_decryptor(key)
     plaintext = aes.decrypt_data(encryptor, crypttext)
     return plaintext
コード例 #2
0
ファイル: dirnode.py プロジェクト: ArtRichards/tahoe-lafs
 def _decrypt_rwcapdata(self, encwrcap):
     salt = encwrcap[:16]
     crypttext = encwrcap[16:-32]
     key = hashutil.mutable_rwcap_key_hash(salt, self._node.get_writekey())
     cryptor = AES(key)
     plaintext = cryptor.process(crypttext)
     return plaintext
コード例 #3
0
 def _decrypt_rwcapdata(self, encwrcap):
     salt = encwrcap[:16]
     crypttext = encwrcap[16:-32]
     key = hashutil.mutable_rwcap_key_hash(salt, self._node.get_writekey())
     cryptor = AES(key)
     plaintext = cryptor.process(crypttext)
     return plaintext
コード例 #4
0
def _encrypt_rw_uri(writekey, rw_uri):
    precondition(isinstance(rw_uri, str), rw_uri)
    precondition(isinstance(writekey, str), writekey)

    salt = hashutil.mutable_rwcap_salt_hash(rw_uri)
    key = hashutil.mutable_rwcap_key_hash(salt, writekey)
    encryptor = aes.create_encryptor(key)
    crypttext = aes.encrypt_data(encryptor, rw_uri)
    mac = hashutil.hmac(key, salt + crypttext)
    assert len(mac) == 32
    return salt + crypttext + mac
コード例 #5
0
ファイル: dirnode.py プロジェクト: ArtRichards/tahoe-lafs
def _encrypt_rw_uri(writekey, rw_uri):
    precondition(isinstance(rw_uri, str), rw_uri)
    precondition(isinstance(writekey, str), writekey)

    salt = hashutil.mutable_rwcap_salt_hash(rw_uri)
    key = hashutil.mutable_rwcap_key_hash(salt, writekey)
    cryptor = AES(key)
    crypttext = cryptor.process(rw_uri)
    mac = hashutil.hmac(key, salt + crypttext)
    assert len(mac) == 32
    return salt + crypttext + mac
コード例 #6
0
def _encrypt_rw_uri(writekey, rw_uri):
    precondition(isinstance(rw_uri, str), rw_uri)
    precondition(isinstance(writekey, str), writekey)

    salt = hashutil.mutable_rwcap_salt_hash(rw_uri)
    key = hashutil.mutable_rwcap_key_hash(salt, writekey)
    cryptor = AES(key)
    crypttext = cryptor.process(rw_uri)
    mac = hashutil.hmac(key, salt + crypttext)
    assert len(mac) == 32
    return salt + crypttext + mac