# How weak/strong is this hand cipher? (updated) [closed]

In simple steps here the system:

first write text.

hand cipher

then divide into groups of three letters:

han dci phe r

then choose a key consisting of three letters, for example car and encrypt first three letters with the key han + car => kbf.

Then take the result kbf and encrypt the second three letters dci + kbf and the result to encrypt the next third three letters and so on until the end.

How strong is this system?

oct22 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- oct26 (updated)

Hello again , I read a little and work a much and come with this, if the old system above is weak. What about that;

will divide the plain text into groubs of three letters, then choose three pass keys each three letters ex. ( are, you, mad )

ill sec ure cip her = plain text divide into sectors

are jdq cit xay ajo = use key no.1 'are'

jdq cit xay ajo iog = cipher text round.1

you isl lbf jcb kmq = use key no.2 'you'

isl lbf jcb kmq tbx = cipher text round.2

vtp hvv ryx clo wnm = cipher text round.3

ill secure cipher = plain text

vtp hvvryx clownm = cipher text

S0................? so embarrassing, really ill secure cipher! just leave the post open a couple of days, no more answers needed today

• Is it absolutely trivial too .? Oct 26 '12 at 15:17
• The attack from before still works, except you need to run it three times. Oct 26 '12 at 15:23
• I know that but its like 3DES now u need to test every key three times is that possible any way, and note that if the txt longer it could be 5,7 or ten letters in each sector. How can u try every key ? and any way I've something hidden will maximum the security. just for this any possible attack. Oct 26 '12 at 15:45
• The attack does not require any key guessing. The key is simply the ciphertext of the previous block. Any data after 3*n chars where n is the length of each key can be trivially decrypted without knowing any of the keys. Oct 26 '12 at 16:02
• How I miss that the only block that encrypted is the first, well... give me more time to think. Oct 26 '12 at 16:22

$c_0 = m_0 + k$

$c_i = m_i + c_{i-1}$ for $i>0$

It's absolutely trivial to break this, since the attacker knows the ciphertext, and thus knows both $c_i$ and $c_{i-1}$.

Decrypting the first group is hard. But to decrypt any group but the first, simply subtract the previous group from the current group $m_i = c_i - c_{i-1}$.

If you use the same key twice, you can also attack the first block by calculating $m^1_0-m^2_0 = c^1_0 - c^2_0$ which for typical texts allows some kind of frequency analysis on the messages. This is a generic attack stream ciphers which are used multiple times with the same key/IV.

Your updates scheme is secure for the first three blocks, and can be broken in exactly the same way as the old one. Just apply the above method three times giving you everything but the first 9 chars.

So once again it's secure if the key is used only once and the message is shorter than the key and insecure otherwise. You're still inferior to vignere with the same key-size, and that's already a pretty bad cipher.

• ok 1.if u dont know how many letters in each block will it be easy too, 2.And what if you dont know anything about the system if you had cipher text only , 3.And last thing what if I zigzag(cipher) the cipher text will that make it more secure. Oct 22 '12 at 10:08
• 1. An unknown block-size doesn't help much either. The attacker simply tries different block-sizes until one fits. 2. The standard assumption in cryptography is that the algorithm is public, and only the key is secret. It's hard to say how much security is gained by hiding the algorithm, so we simply assume that no security is gained. 3. Zig-zag and other obfuscations don't increase security. The attacker can simply undo the transformation, since its unkeyed. Oct 22 '12 at 10:11
• one more question is there any way I can make hard yet easy to apply cipher using a key or there is no way for that? cuz I almost giving up Oct 22 '12 at 10:23
• Oct 22 '12 at 10:24
• would you look at the updated Oct 26 '12 at 15:16

The system looks like Cipher Block Chaining mode with a secret initialization vector (your key) and the identical transformation as the (key-less) block cipher, using character-wise addition instead of bit-wise one.

The initialization vector in CBC is not the thing which provides secrecy (it is usually not secret), and as shown in CodesInChaos' answer, with a keyless cipher it is not secure at all.

For the first block, you essentially have the one-time pad, which means that it is secure, if and only if you only use each "key" once.

So if you make your block size larger than your message size, generate your key truly randomly (dice-throwing or similar) and never ever use a key twice, then your scheme is secure (as it is the one-time-pad). (But then we cut away the core of the scheme, which is the "use the ciphertext as the next key").

• I understand now and study for adding more steps to make it more secure, will post it when done to know if it still had any weakness. Oct 23 '12 at 18:57