Documentation ¶
Overview ¶
This package implements helper methods to be used by the AirDispatch system to take care of all encryption needs. It is split into files based on the types of crypto included.
--- Crypto | - Constants = Constants used for Encoding and Decoding | - Crypto = Methods needed for all Crypto Files | - Encoding = Encoding Keys to Binary (and back again) | - Encryption = AES Encryption and Decryption | - Hash = SHA256 Hashing | - Signatures = ECDSA Signing
Index ¶
- Variables
- func BytesToAddress(toHash []byte) []byte
- func BytesToKey(data []byte) (*ecdsa.PublicKey, error)
- func BytesToRSA(data []byte) (*rsa.PublicKey, error)
- func HashRIP(payload []byte) []byte
- func HashSHA(payload []byte) []byte
- func HybridDecryption(rsaKey *rsa.PrivateKey, encryptedAesKey []byte, ciphertext []byte) (plaintext []byte, error error)
- func KeyToBytes(key *ecdsa.PublicKey) []byte
- func RSAToBytes(key *rsa.PublicKey) []byte
- func SignPayload(key *ecdsa.PrivateKey, payload []byte) (r, s *big.Int, err error)
- func VerifyPayload(key *ecdsa.PublicKey, payload []byte, r, s *big.Int) bool
- func VerifyStringAddress(address string) bool
- type AESKey
- type EncryptedAESKey
Constants ¶
This section is empty.
Variables ¶
var AESKeySize int = 256
var ECDSAPrefix = []byte{3}
var EncryptionNone = []byte{0, 0} // "airdispat.ch/crypto/none"
Seperate Encryption Types
var EncryptionRSA = []byte{1, 1} // "airdispat.ch/crypto/rsa2048-aes256"
var RSAPrefix = []byte("AD-RSA")
var SigningECDSA = []byte{0}
Seperate Signing Types
Functions ¶
func BytesToKey ¶
This function creates an ECDSA Public KEy from a bytestring. This is used to send the public key in the SignedMessage message.
func HybridDecryption ¶
func KeyToBytes ¶
This function writes an ECDSA Public Key to a bytestring. This is used to send the public key in the SignedMessage message.
func SignPayload ¶
Encapsulates ECDSA Signature Generation
func VerifyPayload ¶
Encapsulates ECDSA Signature Verification