Skip to content

Poly1305

Liesware edited this page Jan 29, 2019 · 11 revisions

Message Authentication Codes video

In order to understand hex and type parameters read HASH

Poly1305

spec

Description: Message authentication code based on block cipher.

Uses: Performance is important

Key size: 256 bits

Nonce size: 128 bits

How to ???

import socket
import json
import os,binascii

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)
        print data
	s.close()
	return data

data_js='{"version":1,"algorithm":"POLY1305","type":"string","plaintext":"Hello world!","hex":0,"key":"0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF","nonce":"0123456789ABCDEF0123456789ABCDEF"}'
sending(data_js)

In this example we generate POLY1305 to hex string Hello world! with the key and nonce given.

Json to poly1035 string

{"version":1,"algorithm":"POLY1305","type":"string","plaintext":"your string ",
"hex": BOOL,"key":"Hex string size=32,48,64","nonce":"Hex string size=32"}

Json to poly1035 file

{"version":1,"algorithm":"POLY1305","type":"file","file":"your file","hex": BOOL,
"key":"Hex stringsize=32,48,64","nonce":"Hex string size=32"}
You can’t perform that action at this time.