qq

command module
v0.0.0-...-46589d8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

README

qq

qq is a Diffie-Hellman based peer to peer secure messaging app. The intended use is to establish a shared key for sending and receiving short messages, hence the name qq, short for quick question!

disclaimer

The use of this tool does not guarantee security or suitability for any particular use. Please review the code and use at your own risk.

installation

This step assumes you have Go compiler toolchain installed on your system.

Download the code and cd to the folder, then run

go install

usage

initialize shared key

Let's assume we have Alice and Bob needing to communicate with each other. They both first need to run qq init and walk through steps of sending and receiving each other's public keys:

When Alice and Bob run qq init command in their own terminals, they are requested to send to the other a public key and enter what they received from the other.

Alice:

Alice $ qq init
Send to peer: AjgyeiQBvbed1L3ySG82fraMqTQGe1hkdhFTo6fqTJNKygzEUkZhnn7p9NUT1yWUjtgQMpRPixMPWkwFqDHzmZe8zPdoFw8t4MpcRzmAWQ92YVYWd1v2Pww92MHpCQBpzonCQgN8a8iEibsmFz6XzyAEXSugbQCZRGKw6quLzXxicXo31zob66cBcLrub7QfSAh63fxQPePfYRgsTDE6rpK5Fkby566Z5Nd6yjHUqaaV75xHydwJHfLm7S1KnohQ6kidg8sm97MKRME6zE872TNw7YcGDAh5mFiVHB4fmTsZt5rX1NgUsTKz6GrmHoq4hzjRP1fDx4GyH2a6CqB5fwqCrNyxdw
Enter peer key: 

Bob:

Bob $ qq init
Send to peer: Bz5VPsJyDuEpp9gppAuSE1d5AKc1Q6KrHL93sPBcc9E323uDgrXvFsLG8ePmNQTNb2N7YHvb4mADgj9tJFmvJSjNJ29KLpiFewgcTfsH6Jdj6aqkRUSPFBuZ22JkxMeCYjLTsGrCH9HuueXjoQN8rQY4n8s4QTJo5MyYEf3GpHJ5k7V4Ywkm4fSGMpjzjeeKGqncCUBWERyRcBDcXX8ioeSFzxB6GR1yaMoY9hm88dr7UUEqdgJa4h8de1gTu4QSUNMYVJCEiThNdNoxpPHqAhMpcFCmYND4Umwa41svnGw7dhL2mkH4XSqJ3oCP26Xy1np77HwRqtJ1NXjWwrYQ87fw5s5nXU
Enter peer key: 

When they both enter what they receive from each other, they both receive a shared key that can then be used for communicating

Alice:

Alice $ qq init
Send to peer: AjgyeiQBvbed1L3ySG82fraMqTQGe1hkdhFTo6fqTJNKygzEUkZhnn7p9NUT1yWUjtgQMpRPixMPWkwFqDHzmZe8zPdoFw8t4MpcRzmAWQ92YVYWd1v2Pww92MHpCQBpzonCQgN8a8iEibsmFz6XzyAEXSugbQCZRGKw6quLzXxicXo31zob66cBcLrub7QfSAh63fxQPePfYRgsTDE6rpK5Fkby566Z5Nd6yjHUqaaV75xHydwJHfLm7S1KnohQ6kidg8sm97MKRME6zE872TNw7YcGDAh5mFiVHB4fmTsZt5rX1NgUsTKz6GrmHoq4hzjRP1fDx4GyH2a6CqB5fwqCrNyxdw
Enter peer key: Bz5VPsJyDuEpp9gppAuSE1d5AKc1Q6KrHL93sPBcc9E323uDgrXvFsLG8ePmNQTNb2N7YHvb4mADgj9tJFmvJSjNJ29KLpiFewgcTfsH6Jdj6aqkRUSPFBuZ22JkxMeCYjLTsGrCH9HuueXjoQN8rQY4n8s4QTJo5MyYEf3GpHJ5k7V4Ywkm4fSGMpjzjeeKGqncCUBWERyRcBDcXX8ioeSFzxB6GR1yaMoY9hm88dr7UUEqdgJa4h8de1gTu4QSUNMYVJCEiThNdNoxpPHqAhMpcFCmYND4Umwa41svnGw7dhL2mkH4XSqJ3oCP26Xy1np77HwRqtJ1NXjWwrYQ87fw5s5nXU
export AES_KEY=GT15cXvXqEz4RnMjLMKh3CxBMEmdXeYXsfYeVCuRaoX3

Bob:

Bob $ qq init
Send to peer: Bz5VPsJyDuEpp9gppAuSE1d5AKc1Q6KrHL93sPBcc9E323uDgrXvFsLG8ePmNQTNb2N7YHvb4mADgj9tJFmvJSjNJ29KLpiFewgcTfsH6Jdj6aqkRUSPFBuZ22JkxMeCYjLTsGrCH9HuueXjoQN8rQY4n8s4QTJo5MyYEf3GpHJ5k7V4Ywkm4fSGMpjzjeeKGqncCUBWERyRcBDcXX8ioeSFzxB6GR1yaMoY9hm88dr7UUEqdgJa4h8de1gTu4QSUNMYVJCEiThNdNoxpPHqAhMpcFCmYND4Umwa41svnGw7dhL2mkH4XSqJ3oCP26Xy1np77HwRqtJ1NXjWwrYQ87fw5s5nXU
Enter peer key: AjgyeiQBvbed1L3ySG82fraMqTQGe1hkdhFTo6fqTJNKygzEUkZhnn7p9NUT1yWUjtgQMpRPixMPWkwFqDHzmZe8zPdoFw8t4MpcRzmAWQ92YVYWd1v2Pww92MHpCQBpzonCQgN8a8iEibsmFz6XzyAEXSugbQCZRGKw6quLzXxicXo31zob66cBcLrub7QfSAh63fxQPePfYRgsTDE6rpK5Fkby566Z5Nd6yjHUqaaV75xHydwJHfLm7S1KnohQ6kidg8sm97MKRME6zE872TNw7YcGDAh5mFiVHB4fmTsZt5rX1NgUsTKz6GrmHoq4hzjRP1fDx4GyH2a6CqB5fwqCrNyxdw
export AES_KEY=GT15cXvXqEz4RnMjLMKh3CxBMEmdXeYXsfYeVCuRaoX3

As you can see both of them now have AES_KEY=GT15cXvXqEz4RnMjLMKh3CxBMEmdXeYXsfYeVCuRaoX3 as a shared secret, which can then be used for communicating.

The shared secret needs to be an env. var for commands shown below

communicating messages

Alice can now send message to Bob

Alice $ export AES_KEY=GT15cXvXqEz4RnMjLMKh3CxBMEmdXeYXsfYeVCuRaoX3
Alice $ qq e hi Bob this is Alice
71TX811EMMVztMgtwkhSUtZ5DuRwMu3JNwbcXNLyjBDhvKjVuNBTrAeN1J9r8uzoEV

Bob can then decipher the message from Alice

Bob $ export AES_KEY=GT15cXvXqEz4RnMjLMKh3CxBMEmdXeYXsfYeVCuRaoX3
Bob $ qq d 71TX811EMMVztMgtwkhSUtZ5DuRwMu3JNwbcXNLyjBDhvKjVuNBTrAeN1J9r8uzoEV
hi Bob this is Alice

Documentation

Overview

Copyright © 2022 kubetrail.io authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis
pkg
run

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL