Skip to content

Security library for Go, contains multihash-like library or encryption.

License

Notifications You must be signed in to change notification settings

hazcod/gosecurity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gosecurity Go Report Card codebeat badge License

Wrapper library that contains security-related stuff.

gocrypto

Encrypt and decrypt stuff using authenticated state-of-the-art crypto, provided by golang.org/x/crypto/nacl/secretbox.

usage

func GenerateKey() ([]byte, error)
func Encrypt(input []byte, key []byte) ([]byte, error)
func Decrypt(input []byte, key []byte) ([]byte, error)

format

<nonce(24b)><ciphertext>

gohash

Formats your password hashes in a standard (multihash-like) format so it keeps on working whenever you change algo. Defaults to Argon2id from golang.org/x/crypto/argon2.

usage

func GetHash(input string) (string, error)
func VerifyHash(hash string, input string) (bool, error)
func NeedsRehash(hash string) (bool, error)

format

$argon2$i:4:65536$IO+amcBFUXUETmI=$GpiSk2q1+y2DyfRVsg13BmIGE/oM0GLcM0SOs0s/H/s=

$<algo>$<parameters>$salt$key$

Where parameters contains information for the specific hashing algorhitm, such as size/modus/memory.

About

Security library for Go, contains multihash-like library or encryption.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages