Skip to content
Liesware edited this page Feb 2, 2019 · 2 revisions

In order to understand hex and type parameters read HASH

Qtesla

spec

Description: Post-quantum public-key cryptosystem

Problem: Decisional R-LWE problem

Uses: Digital signatures

  • It only supports "type":"string"

How to ???

import socket
import json
import os,binascii
import random

def sending(message):
	ip = '127.0.0.1'
	port = 6613
	BUFFER_SIZE = 65536
	s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
	s.connect((ip, port))
	s.send(message)
	data = s.recv(BUFFER_SIZE)
	s.close()
	return data

message="Hello world !"
qesla_gen='{"version":1,"algorithm":"QTESLA", "operation":"gen" ,"parameter":"qteslai"}'
qtesla_sign='{"version":1,"algorithm":"QTESLA", "operation":"sign", "type":"string" ,"parameter":"qteslai"}'
qtesla_v='{"version":1,"algorithm":"QTESLA", "operation":"verify", "type":"string" ,"parameter":"qteslai"}'


answ=json.loads(qesla_gen)
data_js_n=sending(json.dumps(answ))
answ=json.loads(data_js_n)
print "Recived: \n" + data_js_n +"\n"
json1=json.loads(qtesla_sign)
json1["privkey"]=answ["privkey"]
json1["plaintext"]=message
data_js_n=sending(json.dumps(json1))
answ1=json.loads(data_js_n)
print "Recived: \n" + data_js_n +"\n"
json2=json.loads(qtesla_v)
json2["pubkey"]=answ["pubkey"]
json2["plaintext"]=message
json2["sign"]=answ1["sign"]
data_js_n=sending(json.dumps(json2))
answ2=json.loads(data_js_n)
print "Recived: \n" + data_js_n +"\n"

In this example we generate a Qtesla key (qteslai), sign and validate "Hello world!" string.

On "parameter" can be one of {"qteslai","qteslaiiisize","qteslaiiispeed"}


Json to gen

{"version":1,"algorithm":"QTESLA", "operation":"gen" ,"parameter":"qtesla flavor"}

Json to sign

{"version":1,"algorithm":"QTESLA", "operation":"sign", "type":"string" ,"parameter":"qtesla flavor", 
"plaintext":"your string",  "hex":BOOL , "privkey": "your hex privkey"}

Json to verify

{"version":1,"algorithm":"QTESLA", "operation":"verify", "type":"string" ,"parameter":"qtesla flavor", 
"plaintext":"your string",  "hex":BOOL , "pubkey": "your hex pubkey", "sign":"your hex signature"}
You can’t perform that action at this time.