Documentation ¶
Overview ¶
Package encpassword implements the password encryption used by Instagram, the encryption is a hybrid encryption, using public-key encryption to encrypt the symmetric key used for encrypting the password.
The public-key encryption is done using NaCl's sealed box, which is based on XSalsa20, Poly1305 and Blake2b. The symmetric encryption is done using AES-256 in GCM mode. You should generate a random key and encrypt the message with that key and zero nonce.
The result of both encryption's is then encoded using base64, which also contains information about the current version and id of the public key used.
Index ¶
Constants ¶
const (
// CurrentVersion is the current version of the password encryption.
CurrentVersion = "10"
)
Variables ¶
This section is empty.
Functions ¶
func EncryptPassword ¶
EncryptPassword encrypts the given password using the given public key.
Types ¶
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
PublicKey represents a public key used for encrypting passwords. You can get the public key from the Instagram web app.
func NewPublicKey ¶
NewPublicKey creates a new public key from the given id, version and key.
func NewPublicKeyCustom ¶
NewPublicKeyCustom creates a new public key from the given id, version and key. Note, version is not checked, and may be invalid or not supported.