Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/archeopternix/password
Password is a helper for encrypting and decrypting passwords based on AES encryption standard
https://github.com/archeopternix/password
Last synced: about 2 months ago
JSON representation
Password is a helper for encrypting and decrypting passwords based on AES encryption standard
- Host: GitHub
- URL: https://github.com/archeopternix/password
- Owner: archeopternix
- License: mit
- Created: 2020-06-30T11:18:40.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-07-06T16:42:05.000Z (over 4 years ago)
- Last Synced: 2024-10-16T19:34:51.095Z (3 months ago)
- Language: Go
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Package password
[GoDoc](https://pkg.go.dev/github.com/archeopternix/password)
install:
```
go get github.com/archeopternix/password
```usage:
```
package mainimport (
"fmt". "github.com/archeopternix/password"
)func main() {
// create a new instance of PasswordCrypter using a secret
ncp := NewCrypter("samplepass")// call the encryption with the 'string' that should be encrypted
cryptstr := ncp.EncryptString("Hello World!")
fmt.Println("Encrypted string: " + cryptstr)fmt.Println("Decrypted string: " + ncp.DecryptString((cryptstr)))
}
```## Crypter
Crypter is a helper for encrypting and decrypting passwords based on
AES encryption standard and stores the secret for further calls. The secret
must be at minimum 6 characters long## EncryptString
EncryptString encrypts a password string based on AES encryption standard
the PasswordCrypter has to be initialized with a passphrase first
```
func (pc Crypter) EncryptString(data string) (encodedstring string)
```
## DecryptString
DecryptString decrypts a password string based on AES encryption standard
the PasswordCrypter has to be initialized with a passphrase first
```
func (pc Crypter) DecryptString(data string) (plaintext string)
```