コード例 #1
0
ファイル: crypto_spec.py プロジェクト: clofresh/blimey
    def it_encrypts_items(self):
        encrypted_key = self.get_key()
        decrypted_key = crypto.decrypt_key(encrypted_key, 'masterpassword123')
        decrypted_item = self.get_item()
        decrypted_item['encrypted'] = {'fields': [{'value': 'foo'}, {'value': 'bar'}, {'ball': '⚽'}]}

        encrypted_item = crypto.encrypt_item(decrypted_item, decrypted_key)
        redecrypted_item = crypto.decrypt_item(encrypted_item, decrypted_key)

        assert redecrypted_item['encrypted']['fields'][0]['value'] == 'foo'
        assert redecrypted_item['encrypted']['fields'][1]['value'] == 'bar'
コード例 #2
0
ファイル: crypto_spec.py プロジェクト: NeilBryant/blimey
    def it_encrypts_items(self):
        encrypted_key = self.get_key()
        decrypted_key = crypto.decrypt_key(encrypted_key, 'masterpassword123')
        decrypted_item = self.get_item()
        decrypted_item['encrypted'] = {
            'fields': [{
                'value': 'foo'
            }, {
                'value': 'bar'
            }, {
                'ball': '⚽'
            }]
        }

        encrypted_item = crypto.encrypt_item(decrypted_item, decrypted_key)
        redecrypted_item = crypto.decrypt_item(encrypted_item, decrypted_key)

        assert redecrypted_item['encrypted']['fields'][0]['value'] == 'foo'
        assert redecrypted_item['encrypted']['fields'][1]['value'] == 'bar'
コード例 #3
0
 def _encrypt_item(self, item):
     return crypto.encrypt_item(item, self._get_key_for_item(item))
コード例 #4
0
ファイル: data_source.py プロジェクト: clofresh/blimey
 def _encrypt_item(self, item):
     return crypto.encrypt_item(item, self._get_key_for_item(item))