{"id":19538792,"url":"https://github.com/jadsongmatos/cryptopals","last_synced_at":"2026-05-11T12:39:23.526Z","repository":{"id":129179783,"uuid":"596512837","full_name":"jadsongmatos/cryptopals","owner":"jadsongmatos","description":null,"archived":false,"fork":false,"pushed_at":"2023-02-03T02:45:44.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-08T18:18:18.323Z","etag":null,"topics":["attacks","challenges","ciphers","cryptography","decryption","encryption","hashes","security"],"latest_commit_sha":null,"homepage":"https://jadsongmatos.github.io/cryptopals/","language":"Rust","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/jadsongmatos.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":"2023-02-02T10:51:12.000Z","updated_at":"2023-02-03T02:52:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"fd725ba0-afca-4747-8954-4fe0a281fd5d","html_url":"https://github.com/jadsongmatos/cryptopals","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jadsongmatos%2Fcryptopals","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jadsongmatos%2Fcryptopals/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jadsongmatos%2Fcryptopals/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jadsongmatos%2Fcryptopals/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jadsongmatos","download_url":"https://codeload.github.com/jadsongmatos/cryptopals/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240794937,"owners_count":19858719,"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":["attacks","challenges","ciphers","cryptography","decryption","encryption","hashes","security"],"created_at":"2024-11-11T02:36:54.524Z","updated_at":"2026-05-11T12:39:18.504Z","avatar_url":"https://github.com/jadsongmatos.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Crypto Challenge Set 1\n\n## Convert hex to base64\nThe string: `49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d`\n\nShould produce: `SSdtIGtpbGxpbmcgeW91ciBicmFpbiBsaWtlIGEgcG9pc29ub3VzIG11c2hyb29t`\n\nSo go ahead and make that happen. You'll need to use this code for the rest of the exercises.\n\n### 1.rs\n\nThis is a Rust program that converts a hexadecimal string to a base64 string. The program takes the hexadecimal string as a command line argument. The hexadecimal string is first converted to a decoded string using the `string_to_hex` function and then the `hex_to_base64` function is used to encode the decoded string in base64. If the input is not provided as a command line argument or if there is an error in parsing the hexadecimal string, the program exits with an error code.\n\n\n\n## Fixed XOR\nWrite a function that takes two equal-length buffers and produces their XOR combination.\n\nIf your function works properly, then when you feed it the string: `1c0111001f010100061a024b53535009181c`\n\nafter hex decoding, and when XOR'd against: `686974207468652062756c6c277320657965`\n\nshould produce: `746865206b696420646f6e277420706c6179`\n\n### 2.rs\n\nThis code takes two equal-length hexadecimal strings as command line arguments and performs XOR combination on them. The input hexadecimal strings are first decoded to their respective string representations and then XORed using the `cipher_xor` function. The XOR result is then encoded back to hexadecimal representation and printed on the console. If there are not exactly two arguments, the code exits with the exit code 7.\n\n## Single-byte XOR cipher\nThe hex encoded string: `1b37373331363f78151b7f2b783431333d78397828372d363c78373e783a393b3736`\n\nhas been XOR'd against a single character. Find the key, decrypt the message.\n\nYou can do this by hand. But don't: write code to do it for you.\n\nHow? Devise some method for \"scoring\" a piece of English plaintext. Character frequency is a good metric. Evaluate each output and choose the one with the best score.\n\n### 3.rs\n\nThis is an implementation of a single-byte XOR cipher in Rust programming language. The code takes a hex-encoded string as input and finds the XOR key used to encrypt the string by evaluating the English character frequency of decrypted outputs. The score is calculated by comparing the decrypted output's frequency of letters to the frequency of letters in the English language. The decrypted string with the highest score is considered the correct message. The code consists of several helper functions to handle conversions between hexadecimal and string, XOR encryption/decryption, and scoring the decrypted string.\n\n## Detect single-character XOR\nOne of the 60-character strings in this file has been encrypted by single-character XOR.\n\n### 4.rs\n\nThis code decrypts a single-character XOR encrypted string from a file with multiple strings. It does so by using a hex to string conversion function and then XORing the string with a range of key values from 0 to 255. It calculates a score for each XORed string using an \"analyze_text\" function, which evaluates the frequency of each character in the XORed string compared to the expected frequency of letters in the English language. The XORed string with the highest score is assumed to be the decrypted string. The code then prints the decrypted string and the key used.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjadsongmatos%2Fcryptopals","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjadsongmatos%2Fcryptopals","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjadsongmatos%2Fcryptopals/lists"}