Documentation ¶
Index ¶
- func HybridDecrypt(ciphertext *HybridCipherText, privateKey *operation.Scalar) (msg []byte, err error)
- type HybridCipherText
- func (ciphertext HybridCipherText) Bytes() []byte
- func (ciphertext HybridCipherText) GetMsgEncrypted() []byte
- func (ciphertext HybridCipherText) GetSymKeyEncrypted() []byte
- func (ciphertext HybridCipherText) IsNil() bool
- func (hybridCipherText HybridCipherText) MarshalJSON() ([]byte, error)
- func (ciphertext *HybridCipherText) SetBytes(bytes []byte) error
- func (hybridCipherText *HybridCipherText) UnmarshalJSON(data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HybridDecrypt ¶
func HybridDecrypt(ciphertext *HybridCipherText, privateKey *operation.Scalar) (msg []byte, err error)
hybridDecrypt_Old receives a ciphertext and privateKey it decrypts aesKeyPoint, using ElGamal encryption with privateKey Using X-coordinate of aesKeyPoint to decrypts message
Types ¶
type HybridCipherText ¶
type HybridCipherText struct {
// contains filtered or unexported fields
}
hybridCipherText_Old represents to hybridCipherText_Old for Hybrid encryption Hybrid encryption uses AES scheme to encrypt message with arbitrary size and uses Elgamal encryption to encrypt AES key
func HybridEncrypt ¶
func HybridEncrypt(msg []byte, publicKey *operation.Point) (ciphertext *HybridCipherText, err error)
hybridEncrypt_Old encrypts message with any size, using Publickey to encrypt hybridEncrypt_Old generates AES key by randomize an elliptic point aesKeyPoint and get X-coordinate using AES key to encrypt message After that, using ElGamal encryption encrypt aesKeyPoint using publicKey
func (HybridCipherText) Bytes ¶
func (ciphertext HybridCipherText) Bytes() []byte
Bytes converts ciphertext to bytes array if ciphertext is nil, return empty byte array
func (HybridCipherText) GetMsgEncrypted ¶
func (ciphertext HybridCipherText) GetMsgEncrypted() []byte
func (HybridCipherText) GetSymKeyEncrypted ¶
func (ciphertext HybridCipherText) GetSymKeyEncrypted() []byte
func (HybridCipherText) IsNil ¶
func (ciphertext HybridCipherText) IsNil() bool
isNil check whether ciphertext is nil or not
func (HybridCipherText) MarshalJSON ¶
func (hybridCipherText HybridCipherText) MarshalJSON() ([]byte, error)
func (*HybridCipherText) SetBytes ¶
func (ciphertext *HybridCipherText) SetBytes(bytes []byte) error
SetBytes reverts bytes array to hybridCipherText_Old
func (*HybridCipherText) UnmarshalJSON ¶
func (hybridCipherText *HybridCipherText) UnmarshalJSON(data []byte) error