// Decrypt decrypts data using the passphrase.
Decrypt decrypts data using the passphrase.
// Decrypt decrypts data using the passphrase .
func Decrypt(data []byte, passphrase string) ([]byte, error) {
	key := createHash(passphrase)
	block, err := aes.NewCipher(key)
	if err != nil {
		return []byte{}, err
	}
	gcm, err := cipher.NewGCM(block)
	if err != nil {
		return []byte{}, err
	}
	nonceSize := gcm.NonceSize()
	nonce, ciphered := data[:nonceSize], data[nonceSize:]
	plaintext, err := gcm.Open(nil, nonce, ciphered, nil)
	if err != nil {
		return []byte{}, err
	}
	return plaintext, nil
}
func Decrypt ( data [ ] byte , passphrase string ) ( [ ] byte , error ) { key := createHash ( passphrase ) block , err := aes . NewCipher ( key ) if err != nil { return [ ] byte { } , err } gcm , err := cipher . NewGCM ( block ) if err != nil { return [ ] byte { } , err } nonceSize := gcm . NonceSize ( ) nonce , ciphered := data [ : nonceSize ] , data [ nonceSize : ] plaintext , err := gcm . Open ( nil , nonce , ciphered , nil ) if err != nil { return [ ] byte { } , err } return plaintext , nil }
Decrypt decrypts data using the passphrase.
Decrypt decrypts data using the passphrase .