All Projects → JustasMasiulis → Xorstr

JustasMasiulis / Xorstr

Licence: apache-2.0
heavily vectorized c++17 compile time string encryption.

Programming Languages

cpp
1120 projects
cpp17
186 projects

Projects that are alternatives of or similar to Xorstr

Yadm
Yet Another Dotfiles Manager
Stars: ✭ 2,982 (+585.52%)
Mutual labels:  encryption, template
Cape
String encryption for Arduino, limited microcontrollers and other embedded systems.
Stars: ✭ 58 (-86.67%)
Mutual labels:  encryption, string
Ring Buffer
simple C++11 ring buffer implementation, allocated and evaluated at compile time
Stars: ✭ 80 (-81.61%)
Mutual labels:  compile-time, template
Androidlibrary
Android library to reveal or obfuscate strings and assets at runtime
Stars: ✭ 162 (-62.76%)
Mutual labels:  encryption, string
Orm Lite
Header-Only, Strong-Typed, Compile-time Object Relation Mapping (ORM) in Modern C++ :-)
Stars: ✭ 164 (-62.3%)
Mutual labels:  compile-time, template
Ustring
The Hoa\Ustring library.
Stars: ✭ 403 (-7.36%)
Mutual labels:  string
Phaser Ce Npm Webpack Typescript Starter Project
Project to get you started with your Phaser-CE (using the npm module) game using Typescript and Webpack for building! No hassle asset management, Google Web Font loader, live server, development vs distribution build pipeline, Electron packaging for desktop builds, and more...
Stars: ✭ 414 (-4.83%)
Mutual labels:  template
Sharpyshell
SharPyShell - tiny and obfuscated ASP.NET webshell for C# web applications
Stars: ✭ 402 (-7.59%)
Mutual labels:  encryption
Framework7 Template Vue Webpack
Deprecated! Framework7 Vue Webpack starter app template with hot-reload & css extraction
Stars: ✭ 399 (-8.28%)
Mutual labels:  template
Scytale
One tool to manage key generation, key storing and encryption on different APIs of Android.
Stars: ✭ 432 (-0.69%)
Mutual labels:  encryption
Link Lock
Password-protect URLs using AES in the browser; create hidden bookmarks without a browser extension
Stars: ✭ 418 (-3.91%)
Mutual labels:  encryption
Flasksaas
A great starting point to build your SaaS in Flask & Python, with Stripe subscription billing 🚀
Stars: ✭ 412 (-5.29%)
Mutual labels:  template
Selenium Maven Template
A maven template for Selenium that will let you check out and go.
Stars: ✭ 403 (-7.36%)
Mutual labels:  template
Libdime
The DIME resolver library and command line utilities.
Stars: ✭ 416 (-4.37%)
Mutual labels:  encryption
Vbad
VBA Obfuscation Tools combined with an MS office document generator
Stars: ✭ 403 (-7.36%)
Mutual labels:  encryption
Covertutils
A framework for Backdoor development!
Stars: ✭ 424 (-2.53%)
Mutual labels:  encryption
Aspect Injector
AOP framework for .NET (c#, vb, etc)
Stars: ✭ 398 (-8.51%)
Mutual labels:  compile-time
S2n Tls
s2n : an implementation of the TLS/SSL protocols
Stars: ✭ 4,029 (+826.21%)
Mutual labels:  encryption
Eth Crypto
Cryptographic javascript-functions for ethereum and tutorials to use them with web3js and solidity
Stars: ✭ 420 (-3.45%)
Mutual labels:  encryption
Docker Ipsec Vpn Server
Docker image to run an IPsec VPN server, with IPsec/L2TP, Cisco IPsec and IKEv2
Stars: ✭ 4,356 (+901.38%)
Mutual labels:  encryption

xorstr

A heavily vectorized c++17 compile time string encryption.

usage

auto xs = xorstr("Adasdads"); // xorstr(L"Adasdads") supported too
xs.crypt(); // does a pass of xor encryption
xs.get(); // returns pointer to data
xs.crypt_get(); // same as calling crypt() and then get()
xs.size(); // returns string size

noteworthy things

  • All keys are 64bit and generated during compile time.
  • Data blocks go in increments of 16 bytes so some space may be wasted.
  • The code has been crafted so that all the data would be embedded directly into code and not stored on .rdata and such.
  • The entirety of string encryption and decryption will be inlined.

supported compilers and platforms

Tested to be working on clang 5.0+, gcc 7.1+ and MSVC v141. If your CPU does not support AVX define JM_XORSTR_DISABLE_AVX_INTRINSICS to only use SSE.

example assembly output

Input code

int main() {
    // or alternatively xorstr_(...) which includes crypt_get call
    std::puts(xorstr("an extra long hello_world").crypt_get());
}

Output of gcc (trunk)

main:
  movabs rax, -4762152789334367252
  push rbp
  mov rbp, rsp
  and rsp, -32
  sub rsp, 64
  mov QWORD PTR [rsp], rax
  mov rdi, rsp
  movabs rax, -6534519754492314190
  mov QWORD PTR [rsp+8], rax
  movabs rax, -2862143164529545214
  mov QWORD PTR [rsp+16], rax
  movabs rax, -4140208776682645948
  mov QWORD PTR [rsp+24], rax
  vmovdqa ymm1, YMMWORD PTR [rsp]
  movabs rax, -2550414817236710003
  mov QWORD PTR [rsp+32], rax
  movabs rax, -4595755740016602734
  mov QWORD PTR [rsp+40], rax
  movabs rax, -5461194525092864914
  mov QWORD PTR [rsp+48], rax
  movabs rax, -4140208776682645984
  mov QWORD PTR [rsp+56], rax
  vpxor ymm0, ymm1, YMMWORD PTR [rsp+32]
  vmovdqa YMMWORD PTR [rsp], ymm0
  vzeroupper
  call puts
  xor eax, eax
  leave
  ret
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].