![]() |
|
Creating a Dynamic XOR Cipher: HMAC-Seeded Security (Custom XOR encryption)) - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Hacks, Exploits, and Various Discussions (https://hackforums.net/forumdisplay.php?fid=45) +--- Forum: Blackhat • Red Team • Offensive Security (https://hackforums.net/forumdisplay.php?fid=447) +---- Forum: Cryptography, Encryption, and Decryption (https://hackforums.net/forumdisplay.php?fid=126) +---- Thread: Creating a Dynamic XOR Cipher: HMAC-Seeded Security (Custom XOR encryption)) (/showthread.php?tid=6291220) |
Creating a Dynamic XOR Cipher: HMAC-Seeded Security (Custom XOR encryption)) - darkterror - Feb 2, 2025 Hi guys, Today i am gonna share my custom "pseudo polymorphic" XOR encryption for files. I am still kinda new to whole cryptography topic, so i am open to discussion about possible improvements or hints how to make it better. 1. Core Mechanism: It’s a stream cipher that uses XOR but with a twist: the XOR key changes dynamically for every byte, based on a seed derived from your password and the data itself. Think of it as a "chameleon" XOR—the key evolves as it encrypts/decrypts. 2. Key Steps:
- Rotating the seed (left/right, based on byte index). - XORing the rotated value with a byte from your key (reused cyclically).
3. Decryption Mirroring: Decryption reverses the process by recomputing the same dynamic keys, thanks to the seed’s dependence on plaintext bytes (which are revealed during decryption). 4. Secure Key Generation: Uses RandomNumberGenerator (cryptographically secure RNG) to create random keys, avoiding weak passwords. Benefits Over Conventional XOR: ✅ Dynamic Keys: Conventional XOR: Uses a fixed key (e.g., key = 0x3A, 0xAA...). Same plaintext = same ciphertext. Easy to crack with patterns. This Code: Every byte’s XOR key depends on the evolving seed + index. Even identical plaintext bytes get different ciphertext! ✅ Key Sensitivity: A 1-bit change in the plaintext or key alters the seed cascade, radically changing all subsequent ciphertext bytes. ✅ Seed Entropy: HMAC-SHA256 ensures the seed isn’t guessable from the key alone. Conventional XOR often uses trivial key-to-seed conversions. ✅ Resilience to Repetition Attacks: In conventional XOR, reused keys expose patterns (e.g., plaintext1 ^ ciphertext1 = key). Here, the dynamic keys break this relationship. ❌ Not "Unbreakable": Still lacks modern cipher features like authentication (tamper detection) or an IV (to prevent same-input/same-output). But it’s way stronger than basic XOR. Code using System;In summary, my custom encryption uses a dynamically evolving key stream (driven by a robust seed derived via HMAC and continuously updated) to achieve a pseudo-polymorphic behavior. This makes it more secure and less predictable than traditional XOR encryption, though it’s still a toy and proof-of-concept example compared to modern ciphers. Feel free to discuss or suggest improvements—I’m all ears! RE: Creating a Dynamic XOR Cipher: HMAC-Seeded Security (Custom XOR encryption)) - derfdo716 - Mar 1, 2025 Brother, I have some advice for this one: In ComputeDynamicKey, if seed is 0, every case of the switch statement will set rotated = 0; Problem is that the switch statement could also a hve a result of 0 if only the first or last N bits are set as the AND 0xFF dropping bits. Also, because of the AND 0xFF operation dropping bits following the ROT, some bits in the ciphertext will be equal to what you would get from XOR operation of the raw stream. RE: Creating a Dynamic XOR Cipher: HMAC-Seeded Security (Custom XOR encryption)) - darkterror - Apr 2, 2025 (Mar 1, 2025 01:31 PM)derfdo716 Wrote: Brother, I have some advice for this one: i am working on new "stronger" encryption, good point will review some of the logic RE: Creating a Dynamic XOR Cipher: HMAC-Seeded Security (Custom XOR encryption)) - eagle8900 - Apr 12, 2025 i need free keyloger pls RE: Creating a Dynamic XOR Cipher: HMAC-Seeded Security (Custom XOR encryption)) - cruzpassport1 - Aug 14, 2026 the password to the file is not correct RE: Creating a Dynamic XOR Cipher: HMAC-Seeded Security (Custom XOR encryption)) - cruzpassport1 - Aug 23, 2026 he password to the file is not correct |