Encryption and decryption a message using password.
You have 13 methods at your disposal, but you can add your own:
void plusFront()
;void plusBack()
;void minusFront()
;void minusBack()
;void xorFront()
;void xorBack()
;void reverse()
;void plusConstant(int constant)
;void minusConstant(int constant)
;void plusSequenceFront()
;void plusSequenceBack()
;void minusSequenceFront()
;void minusSequenceBack()
;
Message: Hello, World!
Password: qwerty1
#include <iostream>
#include "hasher/encryptor.h"
int main()
{
Encryptor e;
e.setPassword("qwerty1");
std::cout << e.hash("Hello, World!") << std::endl;
return 0;
}
After encryption we get the code: 10110110100101111111011101101000001010010000001101001110001101111000011011000001111110110011010000111001
Code: 10110110100101111111011101101000001010010000001101001110001101111000011011000001111110110011010000111001
Password: qwerty1
#include <iostream>
#include "hasher/decryptor.h"
int main()
{
Decryptor d;
d.setPassword("qwerty1");
std::cout << d.hash("10110110100101111111011101101000001010010000001101001110001101111000011011000001111110110011010000111001") << std::endl;
return 0;
}
After decryption we get the message: Hello, World!