Documentation ¶
Overview ¶
password document
PasswordCrypter: is a helper for encrypting and decrypting passwords based on AES encryption standard
usage:
func main() { // create a new instance of PasswordCrypter using a secret ncp := NewPasswordCrypter("samplepass") // call the encryption with the 'password' that should be encrypted cryptstr := ncp.EncryptString("Hello World!") }
The secret must be at minimum 6 characters long
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PasswordCrypter ¶ added in v0.1.1
type PasswordCrypter struct {
// contains filtered or unexported fields
}
PasswordCrypter is a helper for encrypting and decrypting passwords based on AES encryption standard
func NewPasswordCrypter ¶ added in v0.1.1
func NewPasswordCrypter(secretpassphrase string) (pc PasswordCrypter)
NewPasswordCrypter creates a new instance of PasswordCrypter with a new secret string. the length of the secret passphrase must be at lease 6 characters long
func (PasswordCrypter) DecryptString ¶ added in v0.1.1
func (pc PasswordCrypter) DecryptString(data string) (plaintext string)
DecryptString decrypts a password string based on AES encryption standard the PasswordCrypter has to be initialized with a passphrase first
func (PasswordCrypter) EncryptString ¶ added in v0.1.1
func (pc PasswordCrypter) EncryptString(data string) (encodedstring string)
EncryptString encrypts a password string based on AES encryption standard the PasswordCrypter has to be initialized with a passphrase first