| 118 | } |
| 119 | |
| 120 | int command_encrypt_sfrc4(int argc, char** argv) { |
| 121 | if (argc != 6) { |
| 122 | printf("Invalid encrypt_rc4 arguments.\n"); |
| 123 | return 1; |
| 124 | } |
| 125 | |
| 126 | uint64_t hash_key = std::stoull(argv[2], 0, 0); |
| 127 | uint64_t enc_key = std::stoull(argv[3], 0, 0); |
| 128 | const char* input_file_path = argv[4]; |
| 129 | const char* output_file_path = argv[5]; |
| 130 | |
| 131 | std::vector<uint8_t> keys(128, 0); |
| 132 | uint64_t* data = reinterpret_cast<uint64_t*>(keys.data()); |
| 133 | data[0] = hash_key; |
| 134 | data[1] = enc_key; |
| 135 | |
| 136 | size_t size = 0; |
| 137 | auto input = read_file(input_file_path, size); |
| 138 | printf("Reading input file ...\n"); |
| 139 | auto output = SimpleFastRC4::encrypt_model(input.get(), size, keys); |
| 140 | |
| 141 | printf("Encrypting ...\n"); |
| 142 | write_file(output_file_path, output); |
| 143 | |
| 144 | printf("Done.\n"); |
| 145 | return 0; |
| 146 | } |
| 147 | |
| 148 | int command_hash(int argc, char** argv) { |
| 149 | if (argc != 3) { |
nothing calls this directly
no test coverage detected