{"id":20008333,"url":"https://github.com/bethanyuo/crypto_hashes","last_synced_at":"2026-05-16T22:36:07.444Z","repository":{"id":116556382,"uuid":"277826358","full_name":"bethanyuo/crypto_hashes","owner":"bethanyuo","description":"Popular Cryptographic Algorithms using Crypto Libraries: Hashes","archived":false,"fork":false,"pushed_at":"2023-05-01T20:59:55.000Z","size":668,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-06T14:05:03.527Z","etag":null,"topics":["algorithms","crypto-algorithms","crypto-libraries","cryptography","hashing","hashing-algorithm","python"],"latest_commit_sha":null,"homepage":"","language":"Python","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/bethanyuo.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}},"created_at":"2020-07-07T13:37:22.000Z","updated_at":"2020-07-12T17:51:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"d10a61a7-24b7-4530-94a4-8d3666aaf926","html_url":"https://github.com/bethanyuo/crypto_hashes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bethanyuo/crypto_hashes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bethanyuo%2Fcrypto_hashes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bethanyuo%2Fcrypto_hashes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bethanyuo%2Fcrypto_hashes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bethanyuo%2Fcrypto_hashes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bethanyuo","download_url":"https://codeload.github.com/bethanyuo/crypto_hashes/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bethanyuo%2Fcrypto_hashes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33121345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T18:38:32.183Z","status":"ssl_error","status_checked_at":"2026-05-16T18:38:29.903Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["algorithms","crypto-algorithms","crypto-libraries","cryptography","hashing","hashing-algorithm","python"],"created_at":"2024-11-13T07:09:30.027Z","updated_at":"2026-05-16T22:36:07.426Z","avatar_url":"https://github.com/bethanyuo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cryptography: Hashes\n\nWrite code to play with popular cryptographic algorithms using crypto libraries in various programming languages. Calculate hashes, derive keys from passwords, encrypt and decrypt messages, sign messages and verify message signatures, and derive blockchain addresses from ECC private keys.\n\n## Resources\n\nRefer to the demos folder for sample calculations. Refer to the exercise-resources folder for sample inputs and outputs.\n\n## Python Libraries\n* [hashlib](https://pypi.org/project/hashlib/)\n* [hmac](https://pypi.org/project/hmac/)\n* [scrypt](https://pypi.org/project/scrypt/)\n\n## Calculate Hashes\n\nWrite a program to calculate hashes of the given text message using the following hash functions:\n\n1.\tSHA256\n2.  SHA3-256\n3.\tSHA512\n4.\tRIPEMD160\n\n## Calculate HMAC\n\nWrite a program to calculate HMAC-SHA-256 of the given text message by given key.\n\n## Derive Key by Password using SCrypt\n\nWrite a program to calculate a 256-bit key by a given string password and salt using SCrypt.\n\nUse the following configuration for SCrypt:\n*\t16384 iterations\n*\t16 block size\n*\t1 parallel factor\n\nNote: You will also need to install openssl (v1.1.0+) for this package to work if you don’t have it installed already.\n\n## Symmetric Encryption / Decryption\n\nWrite a program to encrypt a text message using a given password. \n*\tDerive a 512-bit key from the password using SCrypt (n=16384, r=16, p=1) with random salt (256 bits).\n\n    *\tSplit the derived key into two 256-bit sub-keys:  \n        * encryption key \n        * HMAC key \n\n*\tEncrypt the message using AES-256 (CBC mode with PKCS7 padding) using the encryption key. \n    *\tUse a random 256-bit IV (initialization vector). \n*\tCalculate message authentication code (MAC) using HMAC-SHA256(msg, hmac_key).\n\nInput: message + password. \nOutput: JSON document, holding the following assets:\n\n*\tThe SCrypt parameters: n, r, p, salt (in hex format). \n*\tThe encrypted message (in hex format) from the AES cipher. \n*\tAES parameter: IV (initialization vector) \n*\tThe message authentication code – MAC (in hex format). \n\n![Inputs](./images/input1.png)\n\nWrite a program to decrypt the encrypted message using a given password. \n*\tDerive a 512-bit key from the password using SCrypt (n=16384, r=16, p=1) with the salt (from the JSON). \n\n    *\tSplit the derived key into two 256-bit sub-keys:  \n        * encryption key \n        * HMAC key. \n        \n*\tCalculate message authentication code (MAC) using HMAC-SHA256(msg, hmac_key). \n    *\tCompare the MAC with the MAC in the JSON document  → correct / wrong password. \n    \n*\tDecrypt the message using AES-256 (CBC mode with PKCS7 padding) using the encryption key and the IV from the JSON. \n\n![Outputs](./images/output1.png)\n\n### Module\nMI1: Module 3: E1\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbethanyuo%2Fcrypto_hashes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbethanyuo%2Fcrypto_hashes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbethanyuo%2Fcrypto_hashes/lists"}