Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPass ¶
CheckPass takes argument ps(string),id(int), perms(int). Where: ps is the password in string form, id is the id of the post and perms is the post permissions it returns a bool based on it's success
func EncryptBytes ¶
EncryptBytes is used to encrypt bytes with a key, pretty self-explanatory.. takes a byte slice b and a pointer to a 32 byte array key returns a byte slice (ct) and a error (err)
func GetEncKey ¶
GetEncKey gets the encryption key used for the file by decrypting the stored-key with the passord scrypt-hash takes a pointer to model.Post as the only argument
and returns a 32 length byte array
func GetToken ¶
func GetToken() string
GetToken generates a random token used to prefent CSRF attacks
func RequestDecrypt ¶
RequestDecrypt decrypts the post if the field post.Crypto.Hash is the correct password. It takes a pointer to the model.Post as the only argument and returns a bool based on if the post is successfully decrypted
func SecurePost ¶
SecurePost generates a secure post for a unencrypted post. encryption varies based upon PostPerms takes a pointer to model.Post and a unencrypted password-string as arguments returns nothing
Types ¶
This section is empty.