IBE (Identitiy Based Encryption)
Master Key Generation
edgetk -pkey setup -algorithm bls12381 -master "Master.pem" -pass nil -pub "MasterPublic.pem"
Master key pair generated successfully:
Master Key saved to: albanese.atwebpages.com/directrix/Master.pem
Public Key saved to: albanese.atwebpages.com/directrix/MasterPublic.pem
Fingerprint: 1ZYlnPS3c/IA+GYNT7/VvwK3BsBKuOFqiOlZOOPl6DQ=
BLS12-381
+-----------------+
|OB^^^%^O^@%#^^^^^|
|=E*XO^o^.#B^^^^^^|
|+.o=+ &oo+B=O@^O^|
| o . +Xoo.B+&+|
| ..S.* o.=.o|
| ..* o...|
| |
| |
| |
+-----------------+
User 1 Private Key Generation
edgetk -pkey keygen -algorithm bls12381 -master "Master.pem" -prv "Private1.pem" -passout nil -id "user1"
User 1's private key generated successfully:
Private Key saved to: albanese.atwebpages.com/directrix/Private1.pem
User 2 Private Key Generation
edgetk -pkey keygen -algorithm bls12381 -master "Master.pem" -prv "Private2.pem" -passout nil -id "user2"
User 2's private key generated successfully:
Private Key saved to: albanese.atwebpages.com/directrix/Private2.pem
Key Details
edgetk -pkey text -key "Master.pem"
Master key details:
-----BEGIN BLS12381 MASTER KEY-----
kcd21ZE2PIbv7Ka0/W0Yw3w3dvH2tP8xpxWMnP7bCdA=
-----END BLS12381 MASTER KEY-----
MasterKey:
91:c7:76:d5:91:36:3c:86:ef:ec:a6:b4:fd:6d:18:
c3:7c:37:76:f1:f6:b4:ff:31:a7:15:8c:9c:fe:db:
09:d0
PublicKey:
ae:0f:1a:be:b1:09:c2:f9:fc:58:57:1c:66:f0:93:
21:9a:cb:3f:0f:e2:f4:d6:d1:72:60:10:fd:ed:f4:
e1:1a:4f:16:57:bd:83:9d:da:e7:a7:bd:80:76:3d:
d9:7c:cf:0c:2c:3d:07:0d:1e:5f:3c:d0:3c:fd:74:
7e:9c:77:8a:d6:c3:27:ec:e9:49:60:1f:93:0c:c6:
54:61:6a:cf:c9:3c:01:81:03:ca:af:2d:41:21:2b:
cd:06:0f:9d:7f:58
Curve: BLS12381
edgetk -pkey text -key "Private1.pem"
User 1's Private key details:
-----BEGIN BLS12381 SECRET KEY-----
DEWq7LUcBr//Y38+NZbJEmFsYxR+E5Y0GzZrdPMvStE=
-----END BLS12381 SECRET KEY-----
SecretKey:
0c:45:aa:ec:b5:1c:06:bf:ff:63:7f:3e:35:96:c9:
12:61:6c:63:14:7e:13:96:34:1b:36:6b:74:f3:2f:
4a:d1
Curve: BLS12381
edgetk -pkey text -key "Private2.pem"
User 2's Private key details:
-----BEGIN BLS12381 SECRET KEY-----
HANsFX+X3edI0MLldPOWxtwRp48V4vTHDYjT7fBGbZE=
-----END BLS12381 SECRET KEY-----
SecretKey:
1c:03:6c:15:7f:97:dd:e7:48:d0:c2:e5:74:f3:96:
c6:dc:11:a7:8f:15:e2:f4:c7:0d:88:d3:ed:f0:46:
6d:91
Curve: BLS12381
edgetk -pkey text -key "MasterPublic.pem"
Master public key details:
-----BEGIN BLS12381 PUBLIC KEY-----
rg8avrEJwvn8WFccZvCTIZrLPw/i9NbRcmAQ/e304RpPFle9g53a56e9gHY92XzP
DCw9Bw0eXzzQPP10fpx3itbDJ+zpSWAfkwzGVGFqz8k8AYEDyq8tQSErzQYPnX9Y
-----END BLS12381 PUBLIC KEY-----
PublicKey:
ae:0f:1a:be:b1:09:c2:f9:fc:58:57:1c:66:f0:93:
21:9a:cb:3f:0f:e2:f4:d6:d1:72:60:10:fd:ed:f4:
e1:1a:4f:16:57:bd:83:9d:da:e7:a7:bd:80:76:3d:
d9:7c:cf:0c:2c:3d:07:0d:1e:5f:3c:d0:3c:fd:74:
7e:9c:77:8a:d6:c3:27:ec:e9:49:60:1f:93:0c:c6:
54:61:6a:cf:c9:3c:01:81:03:ca:af:2d:41:21:2b:
cd:06:0f:9d:7f:58
Curve: BLS12381
KeyID: 617e2d9da4746e95f06bf5134975e3798686d24f
Encryption
edgetk -pkey encrypt -algorithm bls12381 -key "MasterPublic.pem" -id "user1" "test.txt" > "ciphertext.enc"
Message encrypted successfully:
Encrypted message in Base64 (64-character wrap):
MIGzBGARA2Ejawzi2UKvMM5inWe73l3aTAYSzodU4/0gkDsEb+mV3M0m7MzWxUi6
JUBRPWwCbw9DXY6Ye7OlkqVZkMIRmDvP8vFFOqFT2RctF/qgjGbrit5Ib6F1KucD
S+L21aUCIQCoRSWz6bM5cguKXuCFWHsp2DR9Bk43OcK2/al71dNsYwQs0IHzfr0r
kTLlZ7/EkrJY82dGCjGUpvfyG5m/uACdApjygfFvriiaN+B6spEK
edgetk -pkey decrypt -algorithm bls12381 -key "Private1.pem" "ciphertext.enc"
Message decrypted successfully:
Portability, Compatibility, Interoperability
Key Exchange
edgetk -pkey derive -algorithm bls12381 -key "Private1.pem" -pub "MasterPublic.pem" -id "user2"
User 1 Key exchange completed successfully:
Shared= 25ae35dd2d0183e931440d84297e13b2476c82e598cde46638d3265754d6e132
edgetk -pkey derive -algorithm bls12381 -key "Private2.pem" -pub "MasterPublic.pem" -id "user1"
User 2 Key exchange completed successfully:
Shared= 25ae35dd2d0183e931440d84297e13b2476c82e598cde46638d3265754d6e132
Signature
edgetk -pkey sign -algorithm bls12381 -key "Private1.pem" "test.txt"
Digital signature generated successfully:
86e1d246b89a3dc9fdba8f4c646105e43206ec94c95cef7477b42050e09b9786ef6df44b2929086871cfa64abcb5f785
edgetk -pkey verify -algorithm bls12381 -key "MasterPublic.pem" -id "user1" -signature "86e1d246b89a3dc9fdba8f4c646105e43206ec94c95cef7477b42050e09b9786ef6df44b2929086871cfa64abcb5f785" "test.txt"
Signature verified successfully:
Verified: true