EDGE Toolkit Technical Guideline

Elliptic Curve-based ElGamal Key Agreement Scheme (ECKA-EG)

EC-ElGamal Key Pair Generation

edgetk -pkey keygen -algorithm ec-elgamal -curve bls12381g2 -prv "Private.pem" -pass nil -pub "Public.pem" 2>&1
ElGamal key pair generated successfully:
Private Key saved to: albanese.atwebpages.com/directrix/Private.pem
Public Key saved to: albanese.atwebpages.com/directrix/Public.pem
Fingerprint: mVxmkgAUQB4+A7StRE1mPfebxtSFG/FOIQn4ZfuIblE=
EC-ElGamal (381-bit)
+-----------------+
|      .=O@/^^^^^^|
|       o.XE^^^^^^|
|      .  oX%&^^^^|
|     .   * .@BX..|
|      . S *o+o   |
|       . *  .    |
|                 |
|                 |
|                 |
+-----------------+

Private Key Details

edgetk -pkey text -key "Private.pem"
Private key details:
-----BEGIN EC-ELGAMAL DECRYPTION KEY-----
ICkiLOOJlIMbEBThKXdR5WuugxMltoAr2TyNT/Br0i3LCkJMUzEyMzgxRzI=
-----END EC-ELGAMAL DECRYPTION KEY-----
DecryptionKey:
    20:29:22:2c:e3:89:94:83:1b:10:14:e1:29:77:51:
    e5:6b:ae:83:13:25:b6:80:2b:d9:3c:8d:4f:f0:6b:
    d2:2d:cb:0a:42:4c:53:31:32:33:38:31:47:32
EncryptionKey:
    60:99:68:03:d5:30:73:da:f8:41:32:a1:b6:dd:e9:
    7c:d7:8b:de:7d:53:6c:cc:39:00:ce:71:8c:1d:ac:
    e1:a9:52:2c:fc:bd:99:56:a6:62:4d:99:f3:29:0f:
    b1:2d:7a:bd:0b:d5:72:ed:c7:a1:7c:98:42:26:cd:
    9b:78:c3:5a:27:2b:d4:72:6a:65:88:44:d8:9b:a9:
    37:c7:96:40:4a:1a:a9:95:f5:73:c2:d2:bf:a5:3b:
    cc:2e:11:85:d5:4d:56:0a:42:4c:53:31:32:33:38:
    31:47:32
Curve: BLS12381G2

Public Key Details

edgetk -pkey text -key "Public.pem"
Public key details:
-----BEGIN EC-ELGAMAL ENCRYPTION KEY-----
YJloA9Uwc9r4QTKhtt3pfNeL3n1TbMw5AM5xjB2s4alSLPy9mVamYk2Z8ykPsS16
vQvVcu3HoXyYQibNm3jDWicr1HJqZYhE2JupN8eWQEoaqZX1c8LSv6U7zC4RhdVN
VgpCTFMxMjM4MUcy
-----END EC-ELGAMAL ENCRYPTION KEY-----
EncryptionKey:
    60:99:68:03:d5:30:73:da:f8:41:32:a1:b6:dd:e9:
    7c:d7:8b:de:7d:53:6c:cc:39:00:ce:71:8c:1d:ac:
    e1:a9:52:2c:fc:bd:99:56:a6:62:4d:99:f3:29:0f:
    b1:2d:7a:bd:0b:d5:72:ed:c7:a1:7c:98:42:26:cd:
    9b:78:c3:5a:27:2b:d4:72:6a:65:88:44:d8:9b:a9:
    37:c7:96:40:4a:1a:a9:95:f5:73:c2:d2:bf:a5:3b:
    cc:2e:11:85:d5:4d:56:0a:42:4c:53:31:32:33:38:
    31:47:32
Curve: BLS12381G2

Shared Key Negotiation

edgetk -pkey wrapkey -algorithm ec-elgamal -key "Public.pem" -bits 256
Ciphertext (Wrapped key) generated:
Cipher= 308201250481c016a76988f04e9be9f4ccc1e230be60cd88ff36e9158f4c4997bf307343fb2008a3ad83a1514fd0b5e593379e3a8228da0c89984d642a60b675eaa49f379bd5df52b1ee33cf633abc87178b461339a7159c400992b70831b97f7419b8856d879313ddb9cca1fff1e194547dab45884feadea64110c5047e1055ac06096f52a3e1485e88416b23894bed2c0afd8c1bf73b10991f94f9e38db4bf65c1a3119015758ab2349873109fc5b373df0bee593a4342a04e51da65043f663c3e8c9faa338e046093138a03f4ce3ca185b994af8cd57be17b70dca0bc46be7d6c5a3c159c21be72858cb33f3a6589d51ca4b9776ce08d7f0fac5d4588da9846f53b56bafd67de2ce6b81eb1446a7ed36775d0a807201e66e5739734ab599550410b74da1a5fccc1
Shared= 02a3eca7363f7df0643ba202ea33afaaccf4d0a5a6ee50d0d421da5fdaf492e3

Unwrapping the Ciphertext

edgetk -pkey unwrapkey -algorithm ec-elgamal -key "Private.pem" -cipher 308201250481c016a76988f04e9be9f4ccc1e230be60cd88ff36e9158f4c4997bf307343fb2008a3ad83a1514fd0b5e593379e3a8228da0c89984d642a60b675eaa49f379bd5df52b1ee33cf633abc87178b461339a7159c400992b70831b97f7419b8856d879313ddb9cca1fff1e194547dab45884feadea64110c5047e1055ac06096f52a3e1485e88416b23894bed2c0afd8c1bf73b10991f94f9e38db4bf65c1a3119015758ab2349873109fc5b373df0bee593a4342a04e51da65043f663c3e8c9faa338e046093138a03f4ce3ca185b994af8cd57be17b70dca0bc46be7d6c5a3c159c21be72858cb33f3a6589d51ca4b9776ce08d7f0fac5d4588da9846f53b56bafd67de2ce6b81eb1446a7ed36775d0a807201e66e5739734ab599550410b74da1a5fccc1
Shared key decrypted successfully:
Shared= 02a3eca7363f7df0643ba202ea33afaaccf4d0a5a6ee50d0d421da5fdaf492e3