Documentation
¶
Index ¶
- func CalcModulusBitLen(msgbitlen int) int
- func DecipherMsg(ciphertext []byte, privkey *CipherMsgKey) ([]byte, os.Error)
- func DecryptShortMsg(privkey *rsa.PrivateKey, ciphertext, label []byte) (plaintext []byte, err os.Error)
- func EncipherMsg(plaintext []byte, pubkey *CipherMsgPubKey) ([]byte, os.Error)
- func EncryptShortMsg(pubkey *rsa.PublicKey, plaintext, label []byte) (ciphertext []byte, err os.Error)
- func GetUrandom() (r io.Reader, err os.Error)
- func NewRand() *rand.Rand
- type CipherMsgKey
- type CipherMsgPubKey
- type OnesReader
- type TimedRC4Rand
- type TimedRand
- type U_CipherMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalcModulusBitLen ¶
CalcModulusLen returns the minimum RSA public modulus length, required for encrypting a message with size msgbitlen bits, using the EncryptShortMsg routine.
func DecipherMsg ¶
func DecipherMsg(ciphertext []byte, privkey *CipherMsgKey) ([]byte, os.Error)
func DecryptShortMsg ¶
func EncipherMsg ¶
func EncipherMsg(plaintext []byte, pubkey *CipherMsgPubKey) ([]byte, os.Error)
Encipher a message
func EncryptShortMsg ¶
Types ¶
type CipherMsgKey ¶
type CipherMsgKey struct {
// contains filtered or unexported fields
}
CipherMsgKey
func GenerateCipherMsgKey ¶
func GenerateCipherMsgKey() *CipherMsgKey
func ParseCipherMsgKey ¶
func ParseCipherMsgKey(s string) (k *CipherMsgKey, err os.Error)
TODO: Add length checks
func (*CipherMsgKey) PubKey ¶
func (cmk *CipherMsgKey) PubKey() *CipherMsgPubKey
func (*CipherMsgKey) String ¶
func (cmk *CipherMsgKey) String() string
type CipherMsgPubKey ¶
type CipherMsgPubKey struct {
// contains filtered or unexported fields
}
CipherMsgPubKey
func ParseCipherMsgPubKey ¶
func ParseCipherMsgPubKey(s string) (k *CipherMsgPubKey, err os.Error)
TODO: Add length checks
func (*CipherMsgPubKey) String ¶
func (cmpk *CipherMsgPubKey) String() string
type TimedRC4Rand ¶
Random source using RC4, keyed by time
func NewTimedRC4Rand ¶
func NewTimedRC4Rand() TimedRC4Rand
type TimedRand ¶
Random source using Go's rand, keyed by time
func NewTimedRand ¶
func NewTimedRand() TimedRand
type U_CipherMsg ¶
Click to show internal directories.
Click to hide internal directories.