Skip to content

Implementation of encryption using CRTP and dynamic polymorphism

License

Notifications You must be signed in to change notification settings

D4SuCE/Encryption

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Encryption

Encryption and decryption a message using password.


You have 13 methods at your disposal, but you can add your own:

  1. void plusFront();
  2. void plusBack();
  3. void minusFront();
  4. void minusBack();
  5. void xorFront();
  6. void xorBack();
  7. void reverse();
  8. void plusConstant(int constant);
  9. void minusConstant(int constant);
  10. void plusSequenceFront();
  11. void plusSequenceBack();
  12. void minusSequenceFront();
  13. void minusSequenceBack();

Examples

Encryption

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


Decryption

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!

About

Implementation of encryption using CRTP and dynamic polymorphism

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages