encryption

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Unlicense Imports: 15 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChaChaDecryptBase64String

func ChaChaDecryptBase64String(key string, encrypted string) (result string)

func ChaChaDecryptBytes

func ChaChaDecryptBytes(key string, encrypted_bytes []byte) (result []byte)

func ChaChaDecryptFile

func ChaChaDecryptFile(key string, file_path string) (result_file_path string)

func ChaChaEncryptBytes

func ChaChaEncryptBytes(key string, plain_text_bytes []byte) (result []byte)

func ChaChaEncryptFile

func ChaChaEncryptFile(key string, file_path string) (encrypted_file_path string)

func ChaChaEncryptString

func ChaChaEncryptString(key string, plain_text string) (result string)

func ChaChaGenerateKey

func ChaChaGenerateKey(password string) (key [32]byte)

func ChaChaSharedSecretDecryptMessage

func ChaChaSharedSecretDecryptMessage(shared_secret [32]byte, encrypted_message []byte) (plain_text []byte)

func ChaChaSharedSecretEncryptMessage

func ChaChaSharedSecretEncryptMessage(shared_secret [32]byte, message []byte) (encrypted_message []byte)

func CurveX25519GenerateKeyPair

func CurveX25519GenerateKeyPair() (public_key [32]byte, private_key [32]byte)

func CurveX25519KeyExchange

func CurveX25519KeyExchange(private_key [32]byte, other_public_key [32]byte) (shared_secret [32]byte)

X25519KeyExchange performs a key exchange to compute a shared secret given a private key and another party's public key.

func GenerateEntropyBytes1 added in v1.0.8

func GenerateEntropyBytes1(byte_length int) (result []byte)

func GenerateEntropyBytes2 added in v1.0.8

func GenerateEntropyBytes2(byte_length int) (result []byte)

func GenerateRandomBytes added in v1.0.8

func GenerateRandomBytes(byte_length int) (result []byte)

func GenerateRandomString

func GenerateRandomString(byte_length int) (result string)

func KyberDecrypt

func KyberDecrypt(cipher_text [1568]byte, private_key [3168]byte) (shared_secret [32]byte)

func KyberEncrypt

func KyberEncrypt(public_key [1568]byte) (cipher_text [1568]byte, shared_secret [32]byte)

func KyberGenerateKeyPair

func KyberGenerateKeyPair() (public_key [1568]byte, private_key [3168]byte)

1024 bit keypair lattice space = determined by keypair vectors. public public key = "bad" basis vector = far from perpendicular , long private key = "good" basis vector = close to perpendicular , short - allows the receiver correct the errors of the ciphertext - finding nearest neighbor efficiently - navigate the lattice and perform a form of error correction ( de-noise ) cipher text : - essentially its a "noisy" shared key - its some point in the lattice space that is in-between the real members of the lattice. - its "noisy" , translated away from a true valid point. - the attacker can't tell from which of the original points it was derived from https://cryptopedia.dev/posts/kyber https://www.youtube.com/watch?v=QDdOoYdb748 https://www.youtube.com/watch?v=K026C5YaB3A https://en.wikipedia.org/wiki/Grover's_algorithm

func SecretBoxDecrypt

func SecretBoxDecrypt(key string, encrypted string) (result string)

func SecretBoxEncrypt

func SecretBoxEncrypt(key string, plain_text string) (result string)

func SecretBoxGenerateKey

func SecretBoxGenerateKey(password string) (key [32]byte)

func SecretBoxGenerateRandomKey

func SecretBoxGenerateRandomKey() (key [32]byte)

func Sha256Sum added in v1.0.8

func Sha256Sum(entries [][]byte) (result []byte)

Types

This section is empty.

Jump to

Keyboard shortcuts

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