File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 4040"""
4141
4242
43- def test_decrypt_ok ():
43+ def test_rsa_encrypt_decrypt_ok ():
44+ message_to_be_encrypted = 'some text goes here'
45+
46+ encoder = serializers .Encoder (public_key = _PUBLIC_TEST_KEY )
47+ encrypted_message = encoder .encrypt (unencrypted_text = message_to_be_encrypted )
48+
49+ decoder = serializers .Decoder (private_key = _PRIVATE_TEST_KEY )
50+ decoded_text = decoder .decrypt (encrypted_text = encrypted_message )
51+
52+ assert decoded_text .decode () == message_to_be_encrypted
53+
54+
55+ def test_rsa_decrypt_ok ():
4456 # message encrypted with https://github.com/vspaz/rsa-encrypt-decrypt-golang
4557 encrypted_message = (""">pZ5hVNLt"(c>=Oe-C:AUW*&h><-<J;Cq3g:"Fq$oO*G=nb_6+oM
4658 U2D6G^E8g==scSMLC</^2B"bK[jN\\ aW2Sf<Xu75:F\#PPZ/P$huA;lPOH8HO(.p'dE#:d)'.+.
@@ -55,7 +67,7 @@ def test_decrypt_ok():
5567 assert decoded_text .decode () == 'some text data'
5668
5769
58- def test_encrypt_decrypt_ok ():
70+ def test_encrypt_decrypt_with_base85_ok ():
5971 message_to_be_encrypted = 'some text goes here'
6072 encoder = serializers .Encoder (public_key = _PUBLIC_TEST_KEY )
6173 encrypted_message = encoder .encrypt (unencrypted_text = message_to_be_encrypted )
You can’t perform that action at this time.
0 commit comments