Discover Packages
github.com/metalnem/cryptopals-go
package
module
Version:
v0.0.0-...-89ecc63
Opens a new window with list of versions in this module.
Published: Nov 1, 2018
License: MIT
Opens a new window with license information.
Imports: 27
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
Matasano Crypto Challenges
Go solutions to the Matasano Crypto Challenges (http://cryptopals.com/ ). Solutions to the previous challenges are written in Erlang and can be found here .
Break an MD4 keyed MAC using length extension (problem , solution , test )
Implement and break HMAC-SHA1 with an artificial timing leak (problem , solution , test )
Break HMAC-SHA1 with a slightly less artificial timing leak (problem , solution , test )
Implement Diffie-Hellman (problem , solution , test )
Implement a MITM key-fixing attack on Diffie-Hellman with parameter injection (problem , solution , test )
Implement DH with negotiated groups, and break with malicious "g" parameters (problem , solution , test )
Implement Secure Remote Password (SRP) (problem , solution , test )
Break SRP with a zero key (problem , solution , test )
Offline dictionary attack on simplified SRP (problem , solution , test )
Implement RSA (problem , solution , test )
Implement an E=3 RSA Broadcast attack (problem , solution , test )
Implement unpadded message recovery oracle (problem , solution , test )
Bleichenbacher's e=3 RSA Attack (problem , solution , test )
DSA key recovery from nonce (problem , solution , test )
DSA nonce recovery from repeated nonce (problem , solution , test )
DSA parameter tampering (problem , solution , test )
RSA parity oracle (problem , solution , test )
Bleichenbacher's PKCS 1.5 Padding Oracle (Simple Case) (problem , solution , test )
Bleichenbacher's PKCS 1.5 Padding Oracle (Complete Case) (problem , solution , test )
CBC-MAC Message Forgery (problem , solution , test )
Hashing with CBC-MAC (problem , solution , test )
Compression Ratio Side-Channel Attacks (problem , solution , test )
Diffie-Hellman Revisited: Small Subgroup Confinement (problem )
Pollard's Method for Catching Kangaroos (problem )
Elliptic Curve Diffie-Hellman and Invalid-Curve Attacks (problem )
Single-Coordinate Ladders and Insecure Twists (problem )
Duplicate-Signature Key Selection in ECDSA (and RSA) (problem )
Key-Recovery Attacks on ECDSA with Biased Nonces (problem )
Key-Recovery Attacks on GCM with Repeated Nonces (problem )
Key-Recovery Attacks on GCM with a Truncated MAC (problem )
Truncated-MAC GCM Revisited: Improving the Key-Recovery Attack via Ciphertext Length Extension (problem )
Exploiting Implementation Errors in Diffie-Hellman (problem )
Useful links
Bleichenbacher's RSA signature forgery based on implementation error (challenge 42)
The Debian PGP disaster that almost was (challenge 43)
DSA requirements for random k value (challenge 44)
Chosen Ciphertext Attacks Against Protocols Based on the RSA Encryption Standard PKCS #1 (challenges 47 and 48)
Why I hate CBC-MAC (challenge 49)
The CRIME attack (challenge 51)
Expand ▾
Collapse ▴
Documentation
¶
Package cryptopals implements the MD4 hash algorithm as defined in RFC 1320 .
BlockSize represents the blocksize of MD4 in bytes.
Size represents the size of an MD4 checksum in bytes.
func AesCbcDecrypt(ciphertext, key []byte ) []byte
AesCbcDecrypt decrypts the ciphertext using given key.
It assumes that IV is prepended to the ciphertext.
func AesCbcEncrypt(message, key []byte ) []byte
AesCbcEncrypt encrypts the message using given key and random IV.
IV is prepended to the ciphertext.
func CbcMacHash(message, key []byte ) []byte
CbcMacHash calculates CBC-MAC hash for a given message using zero IV.
CbcMacSign calculates CBC-MAC for a given message.
IV and MAC are appended to the plaintext.
func CbcMacSignFixedIv(message, key []byte ) []byte
CbcMacSignFixedIv calculates CBC-MAC for a given message using zero IV.
MAC is appended to the plaintext.
CbcMacVerify verifies CBC-MAC for a given message.
It assumes that IV and MAC are appended to the plaintext.
func CbcMacVerifyFixedIv(msg, key []byte ) bool
CbcMacVerifyFixedIv verifies CBC-MAC for a given message.
It assumes that IV is zero and MAC is appended to the plaintext.
New returns a new hash.Hash computing the MD4 checksum.
type Network interface {
Read() interface{}
Write(interface{})
}
Network simulates reliable bidirectional network stream.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.