| 402 | } |
| 403 | |
| 404 | string RSAEncryptString(const char *pubFilename, const char *seed, const char *message) |
| 405 | { |
| 406 | FileSource pubFile(pubFilename, true, new HexDecoder); |
| 407 | RSAES_OAEP_SHA_Encryptor pub(pubFile); |
| 408 | |
| 409 | RandomPool randPool; |
| 410 | randPool.IncorporateEntropy((byte *)seed, strlen(seed)); |
| 411 | |
| 412 | string result; |
| 413 | StringSource(message, true, new PK_EncryptorFilter(randPool, pub, new HexEncoder(new StringSink(result)))); |
| 414 | return result; |
| 415 | } |
| 416 | |
| 417 | string RSADecryptString(const char *privFilename, const char *ciphertext) |
| 418 | { |
no test coverage detected