Giter Club home page Giter Club logo

strcrypt's Introduction

StrCrypt

Compile-time string crypter library for C++

  • Having plain strings stored in the binary file or in memory can help reversering attempts to be much easier.
  • If the program is targeted by string detection scans you had to change the strings everytime you get detected.

What this library do?

  • String data is encrypted compiled-time and decrypted run-time with pseudo random function. (you can customize pseudo random function, default is CRT.rand)
  • String data is can not be seem by IDA code analisis because getting string need to decyrpt with pseudo random function and unique seed.

example usage

#include <iostream>
#include "encrypt_string.h"

int main() {
	//Pay attention to the lifetime of the string!
	//Encrypted string constant can be used as a function parameter. 
	//ex) printf("encrypted string"e);
	//If you want to replace a string pointer without worrying about its lifetime, use the eg suffix. 
	//ex) const char* pStr = "encrypted string"eg;
	
	printf("Just add 'e' suffix to end of string to encrypt your string.\n"e);
	wprintf(L"C++20 required to compile.\n"e);

	char buf[100];
	printf(buf << "works with char buffer \n"e);

	wchar_t wbuf[100];
	wprintf(wbuf << L"works with wchar_t buffer.\n"e);

	std::array<char, 100> stdarr = "works with std::array<char> : constructor\n"e;
	printf(stdarr.data());
	stdarr = "works with std::array<char> : assignment\n"e;
	printf(stdarr.data());

	std::array<wchar_t, 100> wstdarr = L"works with std::array<wchar_t> : constructor\n"e;
	wprintf(wstdarr.data());
	wstdarr = L"works with std::array<wchar_t> : assignment\n"e;
	wprintf(wstdarr.data());

	std::string stdstr = "works with std::string : constructor\n"e;
	printf(stdstr.c_str());
	stdstr = (std::string)"works with std::string : assignment\n"e;
	printf(stdstr.c_str());

	std::wstring wstdstr = L"works with std::wstring : constructor\n"e;
	wprintf(wstdstr.c_str());
	wstdstr = (std::wstring)L"works with std::wstring : assignment\n"e;
	wprintf(wstdstr.c_str());
	return 0;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.