This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #lang rosette/safe | |
| (require rosette/lib/angelic ; provides `choose*` | |
| rosette/lib/destruct) ; provides `destruct` | |
| ; Tell Rosette we really do want to use integers. | |
| (current-bitwidth #f) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| F.<x> = GF(2^8, modulus=GF(2^9).fetch_int((2^8) + 0x1b)) | |
| A = Matrix(F, 64, 64) | |
| v = [137, 110, 79, 199, 218, 137, 20, 176, 83, 199, 244, 109, 98, 39, 156, 116, 86, 219, 77, 125, 243, 0, 101, 85, 143, 123, 124, 37, 120, 223, 213, 198, 67, 193, 214, 169, 213, 35, 156, 16, 56, 210, 166, 58, 207, 215, 37, 78, 77, 204, 32, 205, 154, 92, 207, 79, 233, 97, 252, 86, 190, 25, 139, 240] | |
| matrix = [[16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79], [44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107], [29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // TLDR: | |
| // Whitebox 128-bit rsa with e=17. Input is multiplied by a constant before the RSA | |
| #include <Windows.h> | |
| #include <stdio.h> | |
| #include <stdint.h> | |
| extern "C" void __fastcall rsa_encrypt (uint8_t* in, uint8_t* out); | |
| // 1. Func is ~90kb, and control flow is simple. Should be decompilable just extremely SLOW. |