@@ -5,11 +5,12 @@ import Random
5
5
using ToyPublicKeys
6
6
Random.seed!(42)
7
7
private_key, public_key = ToyPublicKeys.generate_rsa_key_pair(ToyPublicKeys.pkcs1_v1_5, 2048)
8
- msg = "Super secret message!"
8
+ msg = Vector{UInt8}("Super secret message!")
9
+
9
10
println(msg)
10
- encrypted = ToyPublicKeys.encrypt(ToyPublicKeys.pkcs1_v1_5, msg, public_key)
11
+ encrypted = ToyPublicKeys.encrypt(msg, public_key)
11
12
println(encrypted)
12
- decrypted = ToyPublicKeys.decrypt(ToyPublicKeys.pkcs1_v1_5, encrypted, private_key)
13
+ decrypted = ToyPublicKeys.decrypt(encrypted, private_key)
13
14
println(decrypted)
14
15
```
15
16
## Signatures and their verification
@@ -18,11 +19,11 @@ import Random
18
19
using ToyPublicKeys
19
20
Random.seed!(42)
20
21
private_key, public_key = ToyPublicKeys.generate_rsa_key_pair(ToyPublicKeys.pkcs1_v1_5, 2048)
21
- msg = "Super authentic message!"
22
+ msg = Vector{UInt8}( "Super authentic message!")
22
23
println("Currently this feature is disabled")
23
- # println(msg)
24
- # signature = ToyPublicKeys.sign(ToyPublicKeys.pkcs1_v1_5, msg, private_key)
25
- # println(signature)
26
- # authentic = ToyPublicKeys.verify_signature(ToyPublicKeys.pkcs1_v1_5, msg, signature, public_key)
27
- # println(authentic)
24
+ println(msg)
25
+ signature = ToyPublicKeys.sign(msg, private_key)
26
+ println(signature)
27
+ authentic = ToyPublicKeys.verify_signature(msg, signature, public_key)
28
+ println(authentic)
28
29
```
0 commit comments