tagcrypto

package
v0.0.0-...-2f98cdb Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const AutoKeyMaxLength int = 11

AutoKeyMaxLength auto generated key max length

View Source
const UserKeyMaxLength int = 10

UserKeyMaxLength User input key max length

Variables

This section is empty.

Functions

func GenerateUserKey

func GenerateUserKey(encKeyUser string) (string, error)

GenerateUserKey if user input password is less than UserKeyMaxlength

func RandomKeyGen

func RandomKeyGen(n int) (string, error)

RandomKeyGen generate random hex string of any given length

func Tagcrypt

func Tagcrypt(payload string) string

Tagcrypt is called from Flutter

Types

type Payload

type Payload struct {
	/*
		tag_operation: either "insert" (Encrypt data) or "get" (Decrypt)
		user_key: user password maximum of 11 characters
		tag_key: token data stored in NFC tag, if get operation is performed else empty string
		data: Encrypted data, if get operation is performed else empty string
	*/
	TagOperation string `json:"tag_operation"`
	UserKey      string `json:"user_key"`
	TagKey       string `json:"tag_key"`
	Data         string `json:"data"`
}

Payload struct stores data exchanged b/w flutter and Go

Jump to

Keyboard shortcuts

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