- Install latest version
go get -u github.com/Jay-ponda-improwised/encryptionWithGo
- Install spacific version
go get -u github.com/Jay-ponda-improwised/encryptionWithGo@v1.2.0
- Import package and use alice localCrypto
import localCrypto "github.com/Jay-ponda-improwised/encryptionWithGo"
- A struct
CipherTextused to store (encrypted ext with key)
- Entry (It stores encrypted text)
- key (It stores key)
-
Encrypt(entry string) (CipherText, error)
- params:
entry (string): Entry takes string which you want to encrypt.
- returns:
CipherText, error: Which is struct with encrypted-string and key, error
- params:
-
EncrypteIt(entry string, key int64) (string, error)
- params:
entry (string), key (int64): Entry takes string which you want to encrypt, custom key
- returns:
string, error: encrypted string, error
- params:
-
(d CipherText) Decrypt() (string, error)
- returns:
string, error: plain text (decrypted text), error
- returns:
-
DecryptIt(encEntry string, key int64) (string, error)
- params:
entry (string), key (int64): Entry takes string which you want to encrypt.
- returns:
string, error: plain text (decrypted text), error
- params:
EmptyEntryFound: If given entry is empty ("")