Documentation
¶
Index ¶
- Variables
- func AlgoKey(password, salt []byte, iter, keyLen int, h func() hash.Hash) []byte
- func BigExp(x, y, m *big.Int) *big.Int
- func BytesToBig(b []byte) *big.Int
- func BytesXor(a, b []byte) []byte
- func Decrypt(msg, authKey, checkData []byte) ([]byte, error)
- func DecryptAES(data []byte, key string) ([]byte, error)
- func DecryptMessageMTProto(key []byte, msgKey []byte, encrypted []byte, isOriginator bool) (plaintext []byte, err error)
- func DecryptMessageWithTempKeys(msg []byte, nonceSecond, nonceServer *big.Int) ([]byte, error)
- func Encrypt(msg, authKey []byte) (out, msgKey []byte, _ error)
- func EncryptAES(data []byte, key string) ([]byte, error)
- func EncryptMessageMTProto(key []byte, plaintext []byte, isOriginator bool) (msgKey []byte, encrypted []byte, err error)
- func EncryptMessageWithTempKeys(msg []byte, nonceSecond, nonceServer *big.Int) ([]byte, error)
- func EncryptV1(plaintext, authKey []byte) (out, msgKey []byte, _ error)
- func MessageKey(authKey, msgPadded []byte, decode bool) []byte
- func Pad256(b []byte) []byte
- func PasswordHash2(password, salt1, salt2 []byte) []byte
- func RandomBytes(size int) []byte
- type AesBlock
- type AesIgeBlock
- type AesKV
- type Cipher
- type ModPow
- type SrpAnswer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDataTooSmall = errors.New("AES256IGE: data too small") ErrDataNotDivisible = errors.New("AES256IGE: data not divisible by block size") ErrKeySize = errors.New("AES256IGE: invalid key size: must be 256 bits") ErrMsgKeySize = errors.New("AES256IGE: invalid msg_key size: must be 16 bytes") )
Functions ¶
func BytesToBig ¶
func DecryptMessageMTProto ¶ added in v1.7.0
func DecryptMessageMTProto(key []byte, msgKey []byte, encrypted []byte, isOriginator bool) (plaintext []byte, err error)
DecryptMessageMTProto2 decrypts a message using MTProto 2.0 encryption for secret chats x = 0 for originator, x = 8 for responder (same as encryption)
func DecryptMessageWithTempKeys ¶
DecryptMessageWithTempKeys decrypts a message using temporary keys obtained during the Diffie-Hellman key exchange.
func EncryptMessageMTProto ¶ added in v1.7.0
func EncryptMessageMTProto(key []byte, plaintext []byte, isOriginator bool) (msgKey []byte, encrypted []byte, err error)
EncryptMessageMTProto encrypts a message using MTProto 2.0 encryption for secret chats x = 0 for originator, x = 8 for responder
func EncryptMessageWithTempKeys ¶
EncryptMessageWithTempKeys encrypts a message using temporary keys obtained during the Diffie-Hellman key exchange.
func MessageKey ¶
func PasswordHash2 ¶
func RandomBytes ¶
Types ¶
type AesIgeBlock ¶
type AesIgeBlock [48]byte
type Cipher ¶
type Cipher struct {
// contains filtered or unexported fields
}
func (*Cipher) DoAES256IGEdecrypt ¶ added in v1.7.0
func (*Cipher) DoAES256IGEencrypt ¶ added in v1.7.0
Click to show internal directories.
Click to hide internal directories.