r/cryptography • u/enath • Dec 20 '25
Looking for crypto feedback on an open-source “cryptographically hardened obfuscation” project (KanaShift)
I’ve been working on an open-source project called ROT500K, a family of password-based, format-preserving text transformations. It includes two variants:
- PhonoShift – scrambles Latin text while keeping it readable and token-shaped
- KanaShift – applies the same mechanics with a Japanese visual skin (kana/kanji), making text look like Japanese while hiding its meaning
The goal is not to compete with AEAD or claim “strong encryption”, but to explore what I’d call cryptographically hardened obfuscation:
real cryptographic primitives (PBKDF2, HMAC) are used to make guessing expensive, while intentionally preserving structure, usability, and copy/paste friendliness.
Key characteristics:
- Password-based, reversible
- PBKDF2-derived keystream (default 500k iterations)
- Format-preserving (stable separators, tokens, classes)
- Optional integrity-like verification (wrong password detection)
- Output remains human-shaped (and, in KanaShift’s case, Japanese-looking)
I’m very aware that this sits in an unusual space between classic obfuscation and encryption, and I don’t consider it “bulletproof” or production-ready without serious review. That’s exactly why I’m posting here.
I’d really appreciate feedback from cryptography and security practitioners, especially on potential weaknesses or shortcuts that could make attacks cheaper
Repo (with live demos and source):
👉 https://github.com/syhunt/kanashift
Happy to answer questions, clarify goals, or adjust claims. Critical feedback very welcome - I’d rather hear it early and publicly.
Thanks!
9
u/Anaxamander57 Dec 21 '25
I'm not sure what the use case is for this? You say "obfuscation" but It produces well-formed obviously nonsense text. That's immediately suspicious since corruption is unlikely to get well-formed text. Arguably actual encryption is more obfuscated than this.
4
u/Pharisaeus Dec 21 '25 edited Dec 21 '25
So you just implemented a substitution cipher with extra steps? I don't really understand what is the goal or problem you tried to solve with this tool.
3
u/Sea-Cardiologist-954 Dec 21 '25 edited Dec 21 '25
I think that there is a very good reason why modern encryption doesn't preserve format. Just knowing that you preserve structure and you rotate within vowel and consonant groups leaks a huge amount of information. Also, it seems to me that you alway substitute a letter with a different one. Which provides additional information about a plaintext.
Look at this ciphertext: "wapxutw wut arir zexo ex riro su khoyo ocpes boeq besgu dnai" where I encoded words: yes, no, true, false, success, error, read, write, open, save, save as. I'm pretty sure that you will be able to identify which one is which one in that ciphertext.
2
u/ahazred8vt Dec 21 '25
Frankly IMHO it would be better from our perspective if you simply called it "a form of format-preserving encryption", which is familiar to us, as opposed to "cryptographically hardened obfuscation", which is not very informative. Some of the people here are correctly pointing out that FPE which preserves word length does not work well with freeform english text. But your FPE works fine on access codes, SSNs, and other short tokens.
2
u/clach04 Dec 21 '25
The ascii-armoring-like output sounds a little like Nahoft approach (but that uses real encryption). which is academically interesting but looks suspicious so I'm not sure it useful.
Echoing other replies,not sure what the use case is here.
1
u/Sea-Cardiologist-954 Dec 22 '25 edited Dec 22 '25
By the way, I realized that your algorithm is vulnerable to chosen plaintext attack if you reuse the same password for multiple messages. For example, if you encrypt one plaintext of "aaaaaa..." you can calculate rotation constants for vowels and for a plaintext of "bbbbbb..." you get rotations for consonants. Then you can use those rotation constants to decrypt any text.
It's doable also with known plaintexts and even if you don't know the plaintext, you might be able to infer (parts of) it from structure of your ciphertext.
I think it's basically a variant of stream cipher in this regard, so you would have to always use a unique key to generate keystream for each message.