| 507 | } |
| 508 | |
| 509 | string RSAEncryptString(const char *pubFilename, const char *seed, const char *message) |
| 510 | { |
| 511 | FileSource pubFile(pubFilename, true, new HexDecoder); |
| 512 | RSAES_OAEP_SHA_Encryptor pub(pubFile); |
| 513 | |
| 514 | RandomPool randPool; |
| 515 | randPool.IncorporateEntropy((byte *)seed, strlen(seed)); |
| 516 | |
| 517 | string result; |
| 518 | StringSource(message, true, new PK_EncryptorFilter(randPool, pub, new HexEncoder(new StringSink(result)))); |
| 519 | return result; |
| 520 | } |
| 521 | |
| 522 | string RSADecryptString(const char *privFilename, const char *ciphertext) |
| 523 | { |
no test coverage detected