mirror of
https://github.com/KyleBanks/XOREncryption.git
synced 2023-08-10 21:13:15 +03:00

Division operator and modulo operator have the same priority. So the result of "i % sizeof(key)/sizeof(unichar)" is the same as "(i % sizeof(key)) / sizeof(unichar)". But expected result should be "i % (sizeof(key)/sizeof(unichar))".
XOR Encryption
Simple implementation of XOR Encryption/Decrypting in various languages, including:
- C
- C#
- C++
- Dart
- F# by pawelizycki
- Go
- Groovy
- [Java (Android Compatible)](Java (Android compatible)/XOREncryption.java)
- JavaScript (Node.js Compatible)
- Objective-C
- Python
- Ruby
- Visual Basic.NET
This implementation goes beyond the basic single-key model to use multiple keys in a particular sequence, making it that much more difficult to brute-force.
In these examples, I'm encrypting the same string with the same keys in order to keep consistency with the output, and to demonstrate that an encrypted string from a C program can be decrypted in a Java application, or any combination, so long as the keys remain the same.
For an in-depth explanation of the code, check out KyleWBanks.com.
Description
Languages
Visual Basic .NET
11.7%
Objective-C
9.2%
Go
9%
Swift
7.8%
C++
6.2%
Other
56.1%