crypt

package
v0.0.0-...-f253465 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(ciffre string, identityAge []age.Identity) (string, error)

Decrypt decrypts a string with the given age identities and returns the decrypted string.

func DecryptFromIdentityFile

func DecryptFromIdentityFile(ciffre, identityFile string) (string, error)

DecryptFromIdentityFile decrypts a string with the given identity file and returns the decrypted string.

func DecryptFromPassword

func DecryptFromPassword(ciffre, password string) (string, error)

DecryptFromPassword decrypts a string with a password and returns the decrypted string.

func DecryptMultipleCommon

func DecryptMultipleCommon(enctexts []string, chiffre, identityFile string) ([]string, error)

DecryptMultipleCommon decrypts multiple strings with a public secret (chiffre) and returns the multiple decrypted strings.

func Encrypt

func Encrypt(plaintext string, recipients []string) (string, error)

Encrypt encrypts a string with the given recipients (as strings) and returns the encrypted string.

func EncryptMultipleCommon

func EncryptMultipleCommon(plaintexts []string, recipientFile string) ([]string, string, error)

EncryptMultipleCommon encrypts multiple strings with a random secret and returns the multiple encrypted strings. The random secret gets encrypted for the recipients defined in the recipientFile (= public secret). Also returns the public secret.

func EncryptStringWithRecipientFile

func EncryptStringWithRecipientFile(plaintext, recipientFile string) (string, error)

EncryptStringWithPassword encrypts a string with recipients defined in recipientFile and returns the encrypted string.

func EncryptWithPassword

func EncryptWithPassword(plaintext, password string) (string, error)

EncryptWithPassword encrypts a string with a password and returns the encrypted string.

func GetRecipientsFromJSONFile

func GetRecipientsFromJSONFile(filePath string) (map[string]string, error)

GetRecipientsFromJSONFile parses a text file into a slice of strings. It ignores keys that are empty or start with "#".

func NewPlaintextPrivateSecret

func NewPlaintextPrivateSecret() string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳