Monday, July 31, 2017

Starting with Basic File Cryptography (XOR Cipher)

  In this blog post, I'll discuss one interesting basic cipher technique to garble a file: The "XOR Cipher". What it does is obviously apply XOR (outputs true if both inputs are different) function for every bytes.

  It's not rocket-science like other more sophisticated algorithms like AES, DES, or Blowfish; but adequate for blazingly-fast-low-level-security encryption.

  The snippets I will show you adds a little twist. We will only encrypt the first 512 bytes of the file so that our code is scalable for larger files.


The code:


Some test:

No comments:

Post a Comment

Starting with Basic File Cryptography (XOR Cipher)

  In this blog post, I'll discuss one interesting basic cipher technique to garble a file: The "XOR Cipher". What it does is o...