Documentation ¶
Overview ¶
Copyright (c) 2017 Tsuzu
This software is released under the MIT License. https://opensource.org/licenses/MIT
Copyright (c) 2017 Tsuzu ¶
This software is released under the MIT License. https://opensource.org/licenses/MIT
Index ¶
- Constants
- Variables
- func CreateKeyIVForAES128(password string, salt []byte) ([]byte, []byte)
- func CreateKeyIVForAES256(password string, salt []byte) ([]byte, []byte)
- func CreateSalt() ([]byte, error)
- func PBKDF1(password, salt []byte) ([]byte, []byte)
- func ReadByteChannelForFixedSize(ch chan byte, length int) []byte
- func SendByteArrayToChannel(b []byte, ch chan byte)
- type CBCDecryptionStream
- type CBCEncryptionStream
- type CrytionStream
Constants ¶
View Source
const BlockSize = 128 / 8
View Source
const BufReadLength = BlockSize * 2048
View Source
const SaltSize = BlockSize / 2
Variables ¶
View Source
var ErrIllegalLengthOfkey = errors.New("Illegal length of key")
View Source
var ErrIllegalPadding = errors.New("Illegal Padding")
View Source
var ErrIllegalPrefixOfEncrypted = errors.New("Illegal Prefix of Encrypted")
View Source
var ErrInsufficientData = errors.New("Insufficient Data")
View Source
var SaltPrefix = []byte("Salted__")
Functions ¶
func CreateKeyIVForAES128 ¶
[DEPRECETED] This is the same as OpenSSL's, but it is insecure.
func CreateKeyIVForAES256 ¶
[DEPRECETED] This is the same as OpenSSL's, but it is insecure.
func CreateSalt ¶
func SendByteArrayToChannel ¶
Types ¶
type CBCDecryptionStream ¶
type CBCDecryptionStream struct { Password string Key []byte IV []byte Salt []byte EOFFlag bool // contains filtered or unexported fields }
func NewCBCDecryptionStream ¶
func NewCBCDecryptionStream(keyLen int, password string, reader io.Reader) (*CBCDecryptionStream, error)
keyLen only supports 128 or 256
type CBCEncryptionStream ¶
type CBCEncryptionStream struct { Password string Key []byte IV []byte Salt []byte EOFFlag bool // contains filtered or unexported fields }
func NewCBCEncryptionStream ¶
func NewCBCEncryptionStream(keyLen int, password string, reader io.Reader) (*CBCEncryptionStream, error)
keyLen only supports 128 or 256
type CrytionStream ¶
Click to show internal directories.
Click to hide internal directories.