{"id":26633402,"url":"https://github.com/nakedmcse/tscryptopals","last_synced_at":"2026-05-02T14:43:00.215Z","repository":{"id":259657374,"uuid":"879101420","full_name":"nakedmcse/TSCryptopals","owner":"nakedmcse","description":"TS Implementation of Cryptopals challenges","archived":false,"fork":false,"pushed_at":"2024-10-28T05:02:49.000Z","size":69,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-28T08:33:39.045Z","etag":null,"topics":["cryptography","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nakedmcse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-10-27T01:20:54.000Z","updated_at":"2024-10-28T05:02:53.000Z","dependencies_parsed_at":"2024-10-27T06:26:04.695Z","dependency_job_id":"7eb9a478-baa8-4720-b901-3a9165dde177","html_url":"https://github.com/nakedmcse/TSCryptopals","commit_stats":null,"previous_names":["nakedmcse/tscryptopals"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nakedmcse%2FTSCryptopals","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nakedmcse%2FTSCryptopals/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nakedmcse%2FTSCryptopals/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nakedmcse%2FTSCryptopals/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nakedmcse","download_url":"https://codeload.github.com/nakedmcse/TSCryptopals/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245294720,"owners_count":20591909,"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","typescript"],"created_at":"2025-03-24T15:14:37.958Z","updated_at":"2026-05-02T14:43:00.175Z","avatar_url":"https://github.com/nakedmcse.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TSCryptopals\nThis contains a typescript implementation of the cryptopals set 1 challenges.  It has been implemented\nas a library containing the functions, as set of vitest tests for the library and a program (set1) which \nanswers the questions.\n\n## Library\n\nThe library contains the functions necessary for the questions.\n\n### readFile\nThis reads a given file into a line array.\n\n### generateKeys\nThis takes a given key length and returns an array of all keys of that length.  It is limited to 4 characters max.\n\n### combinations\nThis returns a list of all x,y combinations of items from a given list.\n\n### getBlocks\nThis returns a list of blocks of a given block size extracted from a given Buffer.\nAn option maximum number of blocks to return can also be specified.\n\n### hexToBase64\nThis takes a given hex string and returns the base64 encoded version of it.\n\n### fixedXor\nThis takes two given Buffers and if they are the same length it returns a buffer which is the result of xoring them.\nIf they are differing lengths, null is returned.\n\n### repeatingKeyXor\nThis takes a given buffer and a key string and returns a buffer which is repeating xored with the key.\n\n### englishFreqDiff\nThis takes a string and returns a number showing how far it varies from the normal distribution of characters for english.\nLarger numbers mean less likely to be english.\n\n### englishScore\nThis takes a string and returns a number counting how many common english characters are in it.\nLarger numbers mean more likely to be english.\n\n### decodeSingleByteXor\nThis takes a buffer and brute force tries every single byte to decode.  It returns the decoded text and key,\nbased on the best english score.\n\n### hammingDistance\nThis takes two buffers and returns a number equal to the differing number of bits between the two.\n\n### getRepeatingXorKeyLength\nThis takes a buffer and returns the top four most likely key lengths for repeating Xor.\n\u003e **NOTE WELL:**\n\u003e \n\u003eThis is based on statistical analysis and is inacurate for key lengths below 10 characters.\n\n###  decodeRepeatingXor\nThis takes a buffer and returns the most likely decrypted text and key for repeating Xor.\n\u003e **NOTE WELL:**\n\u003e\n\u003eThis is based on statistical analysis and is inaccurate for key lengths below 10 characters or over 40 characters.\n\n###  decodeRepeatingXorBruteForce\nThis takes a buffer and a maximum key length and returns the most likely decrypted text and key for repeating Xor.\n\u003e **NOTE WELL:**\n\u003e\n\u003eThis is brute force intended for short key lengths and is limited to 4 character keys\n\n### decodeAES128ECB\nThis takes an AES 128 ECB encrypted buffer and a string as a key, and returns an decrypted buffer.\n\n### encodeAES128ECB\nThis takes a buffer and a string as a key, and returns an AES 128 ECB encrypted buffer.\n\n### likelyAES128ECB\nThis takes a buffer and returns a boolean indicating true if it is likely AES 128 ECB encrypted.\n\u003e **NOTE WELL:**\n\u003e \n\u003e This is based on looking for repeating blocks, so the original text must also have repeating sets of characters in it\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnakedmcse%2Ftscryptopals","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnakedmcse%2Ftscryptopals","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnakedmcse%2Ftscryptopals/lists"}