{"id":23302380,"url":"https://github.com/lowleveldesign/powercrypto","last_synced_at":"2025-08-01T23:07:43.059Z","repository":{"id":88806212,"uuid":"106870090","full_name":"lowleveldesign/PowerCrypto","owner":"lowleveldesign","description":"PowerShell module with various commands to encode/encrypt/print byte arrays.","archived":false,"fork":false,"pushed_at":"2017-10-15T15:15:24.000Z","size":740,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T22:35:42.521Z","etag":null,"topics":["cryptography","powershell"],"latest_commit_sha":null,"homepage":null,"language":"PowerShell","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/lowleveldesign.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":"2017-10-13T20:25:31.000Z","updated_at":"2024-02-29T10:49:06.000Z","dependencies_parsed_at":"2023-06-12T18:27:56.207Z","dependency_job_id":null,"html_url":"https://github.com/lowleveldesign/PowerCrypto","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lowleveldesign/PowerCrypto","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lowleveldesign%2FPowerCrypto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lowleveldesign%2FPowerCrypto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lowleveldesign%2FPowerCrypto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lowleveldesign%2FPowerCrypto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lowleveldesign","download_url":"https://codeload.github.com/lowleveldesign/PowerCrypto/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lowleveldesign%2FPowerCrypto/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268310789,"owners_count":24230185,"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","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cryptography","powershell"],"created_at":"2024-12-20T10:28:58.094Z","updated_at":"2025-08-01T23:07:43.030Z","avatar_url":"https://github.com/lowleveldesign.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Introduction \n\nPowerShell module with various commands to encode/encrypt/print byte arrays.\n\nCryptographic commands are using implementations from **[the BouncyCastle library](http://bouncycastle.org/csharp/index.html)**. Consider [donating](https://www.bouncycastle.org/donate/index.cgi) them if you like this module.\n\n## Available Commands\n\n#### `Measure-HammingDistance`\n\nCounts Hamming distance between bytes in arrays.\n\n#### `Format-HexPrettyPrint`\n\nNicely prints a byte array. Example:\n\n```\n\u003e Get-Content -Encoding Byte C:\\Windows\\notepad.exe -TotalCount 96 | Format-HexPrettyPrint\n       0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F\n0000: 4d 5a 90 00 03 00 00 00 04 00 00 00 ff ff 00 00  MZ..............\n0010: b8 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00  ........@.......\n0020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................\n0030: 00 00 00 00 00 00 00 00 00 00 00 00 f0 00 00 00  ................\n0040: 0e 1f ba 0e 00 b4 09 cd 21 b8 01 4c cd 21 54 68  ........!..L.!Th\n0050: 69 73 20 70 72 6f 67 72 61 6d 20 63 61 6e 6e 6f  is program canno\n```\n\n#### `Get-RandomBytes`\n\nGenerates a byte array of randomly (cryptographically secure) generated bytes. Example:\n\n```\nPS\u003e Get-RandomBytes -Length 10\n25\n192\n252\n150\n203\n166\n195\n174\n190\n222\n```\n\n#### `ConvertTo-Base64String`\n\nConverts the byte array to the base64 encoded string. Example:\n\n```\nPS\u003e Get-RandomBytes -Length 10 | ConvertTo-Base64String\nLmIN1S5BGcu7RA==\n```\n\n#### `ConvertFrom-Base64String`\n\nConverts the base64 encoded string to the byte array.\n\n#### `ConvertTo-HexString`\n\nConverts a byte array to its HEX representation. Example:\n\n```\nPS\u003e Get-RandomBytes -Length 10 | ConvertTo-HexString\n2d12ba68d2aaa3da9738\n```\n\n#### `ConvertFrom-HexString`\n\nConverts a HEX string to a byte array.\n\n#### `ConvertTo-ByteArray`\n\nConverts string to a byte array using a specified encoding.\n\n#### `ConvertFrom-ByteArray`\n\nConverts a byte array to a string using a specified encoding.\n\n#### `Protect-BinaryMessage`\n\nEncrypts the provided message using a symmetric cipher.\n\n#### `Unprotect-BinaryMessage`\n\nDecrypts the provided cipher text using a symmetric cipher.\n\n#### `Get-MessageDigest`\n\nCalculates a message digests and outputs it as a byte array. Example:\n\n```\nPS\u003e $b = ConvertTo-ByteArray \"test message\"\nPS\u003e Get-MessageDigest -Digest SHA256  $b | ConvertTo-HexString\n3f0a377ba0a4a460ecb616f6507ce0d8cfa3e704025d4fda3ed0c5ca05468728\n```\n\n#### `Get-Mac`\n\nCalculates a message MAC and outputs it as a byte array.\n\n```\nPS\u003e $key = ConvertTo-ByteArray \"YELLOW SUBMARINE\"\nPS\u003e $b = ConvertTo-ByteArray \"test message\"\nPS\u003e Get-Mac -Key $key -BinaryMessage $b | ConvertTo-HexString\ncfd4afbd065cacae3b33a848a9ce716e2d43eb06\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flowleveldesign%2Fpowercrypto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flowleveldesign%2Fpowercrypto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flowleveldesign%2Fpowercrypto/lists"}