crypt

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPassword

func CheckPassword(password string, hash ...string) (bool, error)

CheckPassword сравнивает пароль и хэш. Если хэш явно не указан, то он читается из файла secret в текущем каталоге. Возвращает true, если хэш соответствует паролю.

func ComputeMD5

func ComputeMD5(path string) (md5String string, err error)

ComputeMD5 вычисляет контрольную сумму MD5 файла по указанному пути.

func Decrypt added in v0.3.8

func Decrypt(encryptedString string, keyString string) (decryptedString string)

func Encrypt added in v0.3.8

func Encrypt(stringToEncrypt string, keyString string) (encryptedString string)

func GeneratePasswordAndStoreNewHash

func GeneratePasswordAndStoreNewHash() ([]byte, error)

GeneratePasswordAndStoreNewHash вызывает passPhraseGen и записывает новый хэш пароля на диск и возвращает сгенерированный пароль из простых символов ascii с некоторым исключением для удобства набора на клавиатуре.

Types

This section is empty.

Jump to

Keyboard shortcuts

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