Documentation ¶
Index ¶
- Constants
- func DecryptBytes(encryptedBytes, key, salt []byte) (decryptedBytes []byte, err error)
- func EncryptBytes(inputBytes, key []byte) (encryptedBytes, salt []byte, err error)
- type ChachaCipher
- func (c *ChachaCipher) Decrypt(r io.Reader, w io.Writer) (int, error)
- func (c *ChachaCipher) Encrypt(r io.Reader, w io.Writer) (int, error)
- func (c *ChachaCipher) GetBytesRead() int
- func (c *ChachaCipher) GetBytesWritten() int
- func (c *ChachaCipher) GetChunkSize() int
- func (c *ChachaCipher) GetDerivedKey() []byte
- func (c *ChachaCipher) GetSalt() []byte
- type Cipher
- func NewKPCipherDecrypter(receiverSeed []byte, senderPubKey string) (Cipher, error)
- func NewKPCipherEncrypter(receiverPubKey string, senderSeed []byte) (Cipher, error)
- func NewSymmetricCipher(key []byte, chunkSize int) (Cipher, error)
- func NewSymmetricCipherFromSalt(key, salt []byte, chunkSize int) (Cipher, error)
- type NKeysCipher
- func (nk *NKeysCipher) Decrypt(r io.Reader, w io.Writer) (int, error)
- func (nk *NKeysCipher) Encrypt(r io.Reader, w io.Writer) (int, error)
- func (nk *NKeysCipher) GetBytesRead() int
- func (nk *NKeysCipher) GetBytesWritten() int
- func (nk *NKeysCipher) GetChunkSize() int
- func (nk *NKeysCipher) GetDerivedKey() []byte
- func (nk *NKeysCipher) GetSalt() []byte
- func (nk *NKeysCipher) Wipe()
Constants ¶
View Source
const ( SaltLen = 32 KeyLen = uint32(32) KeyTime = uint32(5) KeyMemory = uint32(64 * 1024) KeyThreads = uint8(4) )
View Source
const BEE_AEAD_DATA = "*21!)4!"
Variables ¶
This section is empty.
Functions ¶
func DecryptBytes ¶
func EncryptBytes ¶
Types ¶
type ChachaCipher ¶
type ChachaCipher struct { ChunkSize int DerivedKey []byte Salt []byte BytesWritten int BytesRead int // contains filtered or unexported fields }
func NewChaChaCipherFromSalt ¶
func NewChaChaCipherFromSalt(key, salt []byte, chunkSize int) (*ChachaCipher, error)
func NewChaChaCipherRandomSalt ¶
func NewChaChaCipherRandomSalt(key []byte, chunkSize int) (*ChachaCipher, error)
func (*ChachaCipher) GetBytesRead ¶
func (c *ChachaCipher) GetBytesRead() int
func (*ChachaCipher) GetBytesWritten ¶
func (c *ChachaCipher) GetBytesWritten() int
func (*ChachaCipher) GetChunkSize ¶
func (c *ChachaCipher) GetChunkSize() int
func (*ChachaCipher) GetDerivedKey ¶
func (c *ChachaCipher) GetDerivedKey() []byte
func (*ChachaCipher) GetSalt ¶
func (c *ChachaCipher) GetSalt() []byte
type Cipher ¶
type Cipher interface { GetBytesRead() int GetBytesWritten() int GetChunkSize() int GetDerivedKey() []byte GetSalt() []byte Decrypt(r io.Reader, w io.Writer) (int, error) Encrypt(r io.Reader, w io.Writer) (int, error) }
func NewKPCipherDecrypter ¶
NewKPCipherDecoder initializes an nkey encoding set
func NewKPCipherEncrypter ¶
NewKPCipherEncoder initializes an nkey decoding set
func NewSymmetricCipher ¶
NewSymmetricCipher would be called for encrypting when the salt needs to be derived.
type NKeysCipher ¶
type NKeysCipher struct { ReceiverKP nkeys.KeyPair ReceiverPubKey string SenderKP nkeys.KeyPair SenderPubKey string BytesRead int BytesWritten int }
func NewNKeysCipherDecrypter ¶
func NewNKeysCipherDecrypter(receiverSeed []byte, senderPubKey string) (*NKeysCipher, error)
func NewNKeysCipherEncrypter ¶
func NewNKeysCipherEncrypter(receiverPubKey string, senderSeed []byte) (*NKeysCipher, error)
func (*NKeysCipher) GetBytesRead ¶
func (nk *NKeysCipher) GetBytesRead() int
func (*NKeysCipher) GetBytesWritten ¶
func (nk *NKeysCipher) GetBytesWritten() int
func (*NKeysCipher) GetChunkSize ¶
func (nk *NKeysCipher) GetChunkSize() int
func (*NKeysCipher) GetDerivedKey ¶
func (nk *NKeysCipher) GetDerivedKey() []byte
func (*NKeysCipher) GetSalt ¶
func (nk *NKeysCipher) GetSalt() []byte
func (*NKeysCipher) Wipe ¶
func (nk *NKeysCipher) Wipe()
Click to show internal directories.
Click to hide internal directories.