Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » External resources » Cripto with Botan
Re: Cripto with Botan [message #22386 is a reply to message #22385] Thu, 09 July 2009 17:44 Go to previous messageGo to previous message
Ruimg is currently offline  Ruimg
Messages: 10
Registered: July 2009
Promising Member
Ok ok here's the Crypto++ lib Smile Laughing

I should make some changes and make a wapper for the lib, in the mean time here's some simple functions


#include "CryptoPP/hex.h"
#include "CryptoPP/dll.h"
#include "CryptoPP/default.h"
#include "CryptoPP/md5.h"
#include "CryptoPP/hex.h"

.....

	String EncryptString(String &instr, String &passPhrase)
	{
		std::string outstr;
	
		CryptoPP::DefaultEncryptorWithMAC encryptor(passPhrase, new CryptoPP::HexEncoder(new CryptoPP::StringSink(outstr)));
		encryptor.Put((byte *)instr.Begin(), instr.GetLength());
		encryptor.MessageEnd();
	
		return outstr;
	}
	
	String DecryptString(String &instr, String &passPhrase)
	{
		std::string outstr;
	
		CryptoPP::HexDecoder decryptor(new CryptoPP::DefaultDecryptorWithMAC(passPhrase, new CryptoPP::StringSink(outstr)));
		decryptor.Put((byte *)instr.Begin(), instr.GetLength());
		decryptor.MessageEnd();
	
		return outstr;
	}
  • Attachment: CryptoPP.7z
    (Size: 702.29KB, Downloaded 644 times)
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Old version in getdeb
Next Topic: an efficient embedded database library
Goto Forum:
  


Current Time: Fri Apr 26 14:59:43 CEST 2024

Total time taken to generate the page: 0.03962 seconds