No title

Anonymous Coward 2018-03-08 08:45:42.011431 UTC

1
2import Crypto.PubKey.ECIES
3import Crypto.ECC
4import Crypto.Error
5import Crypto.PubKey.Curve25519
6import Data.Proxy
7import Data.ByteString.Char8
8
9
10curve = Proxy :: Proxy Curve_X25519
11
12randomString = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
13
14randomSeed = Data.ByteString.Char8.pack randomString
15
16
17receiversSK = Crypto.PubKey.Curve25519.secretKey randomSeed
18receiversPK = Crypto.PubKey.Curve25519.toPublic (throwCryptoError receiversSK)
19
20
21deriveEncrypt curve receiversPK