{"id":27548965,"url":"https://github.com/shaina-gh/md5-mac","last_synced_at":"2026-05-15T23:13:55.871Z","repository":{"id":288118769,"uuid":"966891218","full_name":"shaina-gh/MD5-MAC","owner":"shaina-gh","description":"A Java-based tool to generate secure Message Authentication Codes (MACs) using HMAC-MD5 for verifying data integrity and authenticity. Features MD5 hashing, RFC 2104-compliant key adjustment, and inner/outer hash computation with ipad/opad. Ideal for learning cryptographic integrity checks, with sample key-message inputs and hex-encoded output.","archived":false,"fork":false,"pushed_at":"2025-04-15T16:15:12.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-06T20:41:33.652Z","etag":null,"topics":["cryptography","hashing","java","mac"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shaina-gh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-15T15:55:26.000Z","updated_at":"2025-04-15T16:21:47.000Z","dependencies_parsed_at":"2025-04-15T17:27:47.131Z","dependency_job_id":"7e7ced43-fb55-4304-abd4-5d51861a45b3","html_url":"https://github.com/shaina-gh/MD5-MAC","commit_stats":null,"previous_names":["shaina-gh/md5-mac"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shaina-gh/MD5-MAC","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaina-gh%2FMD5-MAC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaina-gh%2FMD5-MAC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaina-gh%2FMD5-MAC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaina-gh%2FMD5-MAC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shaina-gh","download_url":"https://codeload.github.com/shaina-gh/MD5-MAC/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaina-gh%2FMD5-MAC/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266267336,"owners_count":23902346,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cryptography","hashing","java","mac"],"created_at":"2025-04-19T04:31:08.523Z","updated_at":"2026-05-15T23:13:55.827Z","avatar_url":"https://github.com/shaina-gh.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔐 HMAC-MD5 Implementation in Java\n\n---\n\n### 📌 Author  : Shaina  \n\n---\n\n## 🧠 What is HMAC-MD5?  \nHMAC (Hash-based Message Authentication Code) is a mechanism for verifying data integrity and authenticity using a cryptographic hash function (MD5 in this case). MD5 (Message Digest Algorithm 5) produces a 128-bit hash value, commonly used to validate data integrity. HMAC combines a secret key with the message and applies the hash function twice for enhanced security.\n\n---\n\n## **MD5 Core Operations**:  \n- **Padding**: Adjust message length to align with 512-bit blocks.  \n- **Block Processing**: Divide into 512-bit chunks and process via four rounds of bitwise operations.  \n- **Bitwise Functions**: Non-linear functions (AND, OR, XOR, NOT) applied during rounds.  \n- **Final Digest**: 128-bit output after processing all blocks.\n\n---\n\n## **HMAC-MD5 Steps**:  \n1. **Key Preparation**: Adjust key length to 64 bytes.  \n2. **Inner/Outer Padding**: XOR key with `ipad` (0x36) and `opad` (0x5C).  \n3. **Hashing**: Compute hash of `(key ⊕ ipad) + message`, then hash `(key ⊕ opad) + inner_hash`.\n\n---\n\n## 🎯 Objective  \nThis project demonstrates HMAC-MD5 for generating a Message Authentication Code (MAC) in Java, featuring:  \n- MD5 hash function implementation.  \n- HMAC key adjustment and padding.  \n- Hex-encoded MAC output for verification.\n\n---\n\n## 🛠️ Features  \n- HMAC-MD5 implementation compliant with RFC 2104.  \n- Key handling (truncation/padding to 64 bytes).  \n- Padding logic for MD5 alignment.  \n- Hex string conversion for digest output.\n\n---\n\n## 🧪 HMAC-MD5 Procedure  \n1. **Key Adjustment**:  \n   - Truncate keys longer than 64 bytes to MD5 hash.  \n   - Pad shorter keys with zeros to 64 bytes.  \n2. **Inner Hash**:  \n   - XOR key with `ipad` (0x36).  \n   - Compute MD5 hash of `ipad + message`.  \n3. **Outer Hash**:  \n   - XOR key with `opad` (0x5C).  \n   - Compute MD5 hash of `opad + inner_hash`.  \n4. **MAC Output**: Convert final hash to a 32-character hex string.\n\n---\n\n## ▶️ How to Compile \u0026 Run  \n```bash\njavac HMACMD5.java\njava HMACMD5\n```\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaina-gh%2Fmd5-mac","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshaina-gh%2Fmd5-mac","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaina-gh%2Fmd5-mac/lists"}