|
Download sec/crypto-hash.jsonl from winapiadmin/tinycodinglm: direct link, hf CLI and curl.
- Browser
- Download file 1.29 kB
-
https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/d517dc97f4cfcf6f6f9b7fafc368554f077178b3/sec/crypto-hash.jsonl
- Command line
-
hf download hf://datasets/winapiadmin/tinycodinglm@d517dc97f4cfcf6f6f9b7fafc368554f077178b3/sec/crypto-hash.jsonl
-
curl -L -o crypto-hash.jsonl https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/d517dc97f4cfcf6f6f9b7fafc368554f077178b3/sec/crypto-hash.jsonl
1.29 kB
| {"type": "session", "harness": "opencode", "id": "crypto-hash", "name": "Cryptographic Hashing and MACs"} | |
| {"type": "message", "message": {"role": "system", "content": "You are an expert cryptographer and programmer."}} | |
| {"type": "message", "message": {"role": "user", "content": "Explain cryptographic hashing and MACs"}} | |
| {"type": "message", "message": {"role": "assistant", "content": "Hash functions: arbitrary input -> fixed output. Properties:\n- Preimage resistant: given h, hard to find m with H(m)=h.\n- Second preimage resistant: given m1, hard to find m2 with H(m1)=H(m2).\n- Collision resistant: hard to find any m1!=m2 with H(m1)=H(m2).\n\nSHA-256: 256-bit output. Used in Bitcoin, TLS, digital signatures.\nSHA-3 (Keccak): sponge construction. Different internal structure from SHA-2.\nBLAKE3: very fast, parallelizable. Based on ChaCha.\n\nHMAC: hash-based MAC. HMAC(K,m) = H((K XOR opad) || H((K XOR ipad) || m)). Prevents length extension.\n\nKDF (key derivation): PBKDF2, scrypt, Argon2. Purpose: derive keys from passwords with salt and iterations.\n\nPassword hashing: Argon2id (winner of Password Hashing Competition). Memory-hard, resistant to GPU attacks.\n\nCommitment schemes: hash-based commitment. Commit(m,r) = H(m||r). Reveal (m,r), verify H(m||r) matches."}} | |