Test your cryptanalysis skills. Analyse it.
Try to break the code.
Enter the binary message in the upper box and receive the encrypted text - random numbers will appear in the box below.
The length of the encrypted text is not fixed.
The maximum number of characters in the encrypted text is limited to 1000; if the result is longer, it is truncated.
Enter encrypted text in the box below and tap on 'decrypt' to get the original binary message.
The message is encrypted with random numbers, so it can be combined with one of the steganography tools to hide the encrypted message as noise in an image, for example.
Download the tool from Google Play.
The app interface is rather simple:
Type a binary number in the box above and tap on Encrypt. You can copy the result and send it to someone who can decrypt it by pasting it into the box below and tapping on 'Decrypt'.
Algorithm Specification: Yin Yang Cipher
1. Overview
The Yin Yang Cipher is a custom steganographic algorithm designed to encode binary data into a stream of seemingly random digits (0–9). The cipher uses a secret cyclic digit key (C) and parity-based logic to transform each bit into a variable-length digit sequence.
2. Components
-
C: Secret cyclic key — a list of digits
C = [c₀, c₁, ..., cₖ]where eachcᵢ ∈ {0,1,...,9}. -
M: Binary message (sequence of bits)
M = [b₀, b₁, ..., bₙ], with eachbᵢ ∈ {0,1}. -
E: Ciphered output — a sequence of digits
E = [e₀, e₁, ..., eₘ].
3. Initialization
-
Define the cyclic cipher key
C. It must be shared or stored securely. -
Initialize an empty output list
E. -
Set pointer
i = 0to track the current bit in the messageM. -
Set cipher pointer
k = 0to track position in the cyclic keyC.
4. Start Marker
To mark the beginning of the encoded message:
-
Random digits are generated and appended to
Euntil the first match withC[0]is found. -
The matched digit (
C[0]) is added toEand becomes the start flag.
5. Encoding Loop
For each bit bᵢ in a binary message M:
-
Let
current_cipher = C[k], wherekis the index in the cyclic cipher (k = i mod len(C)). -
Generate a random digit stream
R = [r₁, r₂, ..., rₜ]under the following rules:-
If
bᵢ = 0: generate digits until an odd number is encountered.-
The odd number becomes the first digit
r₁. -
The remaining generated digits are appended in order
r₂, r₃, ..., rₜ.
-
-
If
bᵢ = 1: generate digits until an even number is encountered.-
The even number becomes the first digit
r₁. -
The remaining generated digits follow.
-
-
-
Add sequence
Rto outputE. -
Increment
iandk.
6. Final Output
-
Eis the resulting list of digits representing the ciphered (steganographically encoded) binary message. -
All digits appear to be random and conform to the digit space {0–9}.
7. Decoding Algorithm
Given E and key C:
-
Scan
Euntil the first digit matchingC[0]is found — this is the start marker. -
From the digit after the start marker, decode in steps:
-
For each cipher digit
C[k](cycled), read the next segment of digits:-
The first digit of the segment determines the bit:
-
If it's odd → decoded bit is
0 -
If it's even → decoded bit is
1
-
-
Skip the rest of the digits in that segment (until the next valid leading digit is found)
-
-
-
Repeat until all bits are decoded.
8. Security Notes
-
Obfuscation, not encryption: This is a steganographic algorithm and does not provide strong cryptographic guarantees.
-
The random stream must use a secure PRNG if secrecy is desired.
-
The key
Cmust be kept secret to prevent easy decoding.
9. Potential Enhancements
-
Integrate a keyed PRNG seeded by
Cor a passphrase. -
Add optional message length encoding.
-
Encrypt the binary message with a real cipher (e.g., XOR, AES) before applying Yin Yang encoding.
Notes:
-
cipher: list of digits like[3, 6, 1]— acts as the secret cyclic key. -
The binary message is a string like
"10101". -
Random output will differ each time due to noise.
