Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
28 lines (20 loc) · 744 Bytes

File metadata and controls

28 lines (20 loc) · 744 Bytes
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import unittest
from pubnub.crypto import PubNubCryptodome
from tests.helper import gen_decrypt_func
crypto = PubNubCryptodome()
todecode = 'QfD1NCBJCmt1aPPGU2cshw=='
key = 'testKey'
class TestDecode(unittest.TestCase):
def test_decode_aes(self):
hey = """
dfjn
t564
sdfhp\n
"""
assert crypto.decrypt(key, crypto.encrypt(key, hey)) == hey
assert crypto.decrypt(key, todecode) == "hey-0"
def test_vc_body_decoder(self):
input = b'"9P/7+NNs54o7Go41yh+3rIn8BW0H0ad+mKlKTKGw2i1eoQP1ddHrnIzkRUPEC3ko"'
# print(json.loads(input.decode('utf-8')))
assert {"name": "Alex", "online": True} == \
gen_decrypt_func('testKey')(input.decode('utf-8'))
Morty Proxy This is a proxified and sanitized view of the page, visit original site.