Skip to content
Raphael Kim edited this page Feb 21, 2017 · 1 revision

An example of encoding string

C++ code

#include "endetool.h"

int main( int argc, char** argv )
{
	EnDeTool ende;
	
	// Set a cryptkey in maximum 32 bytes. (recommend to use in minimal 4 bytes)
	ende.cryptkey( "123456789ABCDEFGHIJKLMNOPQRSTUVW" );
	
	// Then input normal string text (UTF-8 ready)
	ende.text( "This string will be encoded to AES-256, then BASE-64 again." );
	if ( ende.encoded() == true )
	{
		printf("%s\n", ende.encodedtext() );
	}
	else
	{
		printf("Failed to encode.\n");
	}
	
	return 0;
}

Result

Cbn6Eh35iGslIcJtCBKp0GIpzxLAdUjMxxVoZe/OYy05YF2zm4HuGRcjOoxg//ARz2TV76CUdbcZMblS/tH05Q==
Clone this wiki locally