Key generation
To communicate securely Bob and Alice need to generate the following key combinations:
- Kyber PK and SK
- Dilithium PK and SK
- ECDSA/ECIES PK and SK
BOB
qrl-cli create-wallet --file wallet_bob.json
qrl-cli create-lattice -f wallet_bob.json -e ephemeral_bob.json -i 0
Generates the following output:
- wallet_bob.json: wallet file
- ephemeral_bob.json: file containing all the private keys and associated tx hash for public keys
- Lattice transaction: d45de896fe45ae443ccf887ae069ee6655a6dc5c5beda8ae70b610e05c57e02a
ALICE
qrl-cli create-wallet --file wallet_alice.json
qrl-cli create-lattice -f wallet_alice.json -e ephemeral_alice.json -i 0
Generates the following output:
- wallet_alice.json: wallet file
- ephemeral_alice.json: file containing all the private keys and associated tx hash for public keys
- Lattice transaction: bd2691cf8940569cc28aac2c8fc6c208dd4b11a89299cff5f23e832f28746df0
EMS communication
- send-initial-message
- receive-initial-message
- send-next-message
- receive-next-message
1. Bob sends initial message
The sender user the following command to send the initial message (channel opening). Local private keys are used (ephemeral_bob.json) and associated public keys are retrieved from corresponding lattice transaction for the sender and for the receiver.
To create the initial message to send to Alice, Bob needs
- Bob's own private keys file (ephemeral_bob.json)
- Alice's lattice tx hash to use
qrl-cli send-initial-message ephemeral_bob.json -h bd2691cf8940569cc28aac2c8fc6c208dd4b11a89299cff5f23e832f28746df0
This commans generates 3 outputs:
- encCypherText.txt: ecnrypted cypher text
- signedMessage.txt containing the secret seed encrypted with the shared key
- List of the next 1000 keys (saved as keyListSender.txt, but should be saved in the localStorage)
The encrypted cypher text (1) and the signed message (2) are sent over to Alice as the channel opening message.
2. Alice receives initial message
Alice receives the channel opening message and needs to :
- extract the shared key from the encrypted cypher text
- decrypt the shared seed with the shared key (1)
- generates the list of the next 1000 keys (saved as keyListReceiver.txt, but should be saved in the localStorage)
qrl-cli receive-initial-message ephemeral_alice.json -h d45de896fe45ae443ccf887ae069ee6655a6dc5c5beda8ae70b610e05c57e02a
3. Send next message
To encrypt following messages, receiver needs to define the key index (position in keyList, this should be tracked to increase automatically) and input the message to encrypt.
qrl-cli send-next-message 1 "test"
The output of the send-next-message is encrypted(test) and is sent over (also saved as encryptedMessage{$index}.txt)
4. Receive next message
To decrypt following messages, the receive only need to know its index (which can be deducted if we keep a counter for each message received)
qrl-cli receive-next-message 1
The decrypted message is currently also saved as decryptedMessage{$index}.txt