A very naive encryption scheme : How would an expert crack it?

  • Thread starter Thread starter Swamp Thing
  • Start date Start date
AI Thread Summary
Alice's encryption scheme involves generating a key K using a random number generator and calculating an irrational number to encrypt plaintext through XOR operations. The security relies on a secret protocol for inserting K into the encrypted message, but this approach is vulnerable if the protocol is discovered. Experts argue that the scheme's reliance on secrecy for both the protocol and the key generation process is a significant weakness, as attackers can exploit predictable elements. Additionally, the discussion highlights that human error and the potential for key reuse could compromise the encryption's integrity. Overall, the method appears flawed and susceptible to various cryptanalytic attacks, emphasizing the need for robust key management and secure protocols.
Swamp Thing
Insights Author
Messages
1,028
Reaction score
762
Alice generates a random series of digits that define a key 0 < K < 1, using a physics based, nearly perfect random generator. She then calculates exp( Pi * K) / 4, or some such irrational number. She calculates as many decimal places as are required to encrypt the block of plain text. She converts the result to hexadecimal. She takes successive pairs of digits of this hex value and XORs them bytewise with the plain text characters. Finally, Alice inserts the hex digits of K among these encryped text characters using a protocol known only to her and Bob.

Bob recovers the digits of K from the received string using the known protocol, and re-generates the key K and the secret number exp(Pi * K ) / 4. Then he XORs this with the plain text (remaining after removing the key digits) and recovers the original plain text.

Eve has no information at all except the messages that Alice transmits to Bob. Can she deduce the scheme and decrypt a corpus of messages?
 
Last edited:
Technology news on Phys.org
Swamp Thing said:
Eve has no information at all except the messages that Alice transmits to Bob. Can she deduce the scheme and decrypt a corpus of messages?
Perhaps not, but that’s the wrong question. Cyphers must be designed on the assumption that an attacker knows everything except the key; an encrypted message must be secure even if the encryption algorithm is known to the attacker. Here you are relying on keeping the “protocol known only to her and Bob” and the function used to generate the irrational number secret.
 
Last edited:
  • Like
Likes PeterDonis and Swamp Thing
Swamp Thing said:
How would an expert crack it?
There is too much confusion, and no depth, so cracking it by cryptanalytic techniques is not really feasible.

Practical cryptanalysis, involves theft of the clear text, at either end. Placing hidden cameras or audio bugs in the workplace could be a technical solution. Bribery, a honey trap, or the threat of violence is also an efficient solution.

If the message has no apparent value, then why show any interest or investment in the contents?

National security is serious, it is not a game. If the message was believed to contain critical information of national importance being leaked, then elimination of either traitor by what appeared to be an accident, or an OD, would quickly resolve the situation in an acceptable manner.
 
There is an old school thing known as s one time pad where sender and receiver have the same pad. The pad is gridded with one or two digits per square. The numbers are all randomly generated.

https://en.m.wikipedia.org/wiki/One-time_pad

To encode a message you convert each letter to its numeric equivalent add it to the number in the square and continue to the next square carefully mapping your message to the squares.

Transmit the encoded values however you want usually it was by telegraph.

With the aid of the receivers one-time pad the message can be decoded by subtracting the numbers out and decoding back to letters.

Its only weakness is if a pad is captured or copied.
 
jedishrfu said:
Its only weakness is if a pad is captured or copied.
OTPs do not work for large data volumes. The OTP fails when those responsible for generating the pads become overworked, or get lazy, and reuse earlier random data in some way.
 
Nugatory said:
Cyphers must be designed on the assumption that an attacker knows everything except the key; an encrypted message must be secure even if the encryption algorithm known to the attacker.
If the K number is pre-shared (and not embedded in the message), I suppose it would meet this criterion?

And in that case, I assume a professional wouldn't find it hard to crack.. but what kind of analysis would yield the key? Hopefully the methods can be understood by someone who is not a number theortician.
 
A fixed key can be attacked by frequency analysis (of letters) or through a brute force search. Your scheme sounds like a Caesar code transferred into modern times.
 
Swamp Thing said:
And in that case, I assume a professional wouldn't find it hard to crack.. but what kind of analysis would yield the key? Hopefully the methods can be understood by someone who is not a number theortician.
If only one K is number used for multiple messages, you just have a Caesar cipher, and as @Fresh42 points out, these are vulnerable to frequency analysis (and even more so to known-plaintext attacks).
If a new key is used for each message, you have created a variant of the one-time-pad (OTP) - but it would be easier to just xor the message with the key. An OTP is theoretically unbreakable, provided that no key is ever reused (this is how the Venona intercepts were deciphered), the key generation process is cryptographically strong (much harder than it sounds), and the enemy doesn't get hold of the key book (many examples through history). In practice, secure key generation and distribution are the great weaknesses of OTP systems; hence the interest in quantum key distribution.

Bruce Schneier's "Applied Cryptography" is seriously outdated now, but its discussion of first principles is still relevant and I recommend it to anyone who wants even a layman's understanding of the subject.
(Schneir also has a blog, https://www.schneier.com/, which is worth following)
 
  • Informative
  • Like
Likes PeterDonis and Swamp Thing
The OP cipher as described seems very messy and prone to errors. It would need to be programmed into a computer of some sort. Spyware on the computer would reveal the program and the clear text as it was entered or displayed.

Cipher clerks are not selected for their intelligence, but for their ability to mindlessly push paper, like bookkeepers. They make mistakes. With time and depth, a good cryptanalyst can read the enemies messages faster, and more accurately than Alice and Bob, the cipher clerks. That happens more often than might be expected, and it gives cryptanalysts the greatest joy and reward for their efforts.
 
  • #10
fresh_42 said:
A fixed key can be attacked by frequency analysis (of letters) or through a brute force search. Your scheme sounds like a Caesar code transferred into modern times.
Hm ... seems to me the XORing removes it from the realm of Ceasar codes, no?
 
  • #11
phinds said:
Hm ... seems to me the XORing removes it from the realm of Ceasar codes, no?
Maybe, I was a bit confused by all the extras that didn't actually add safety, but it sounded to me like a modern version of it. Sure, it isn't a Caesar code, but is it more difficult than that? If you use the key only once and both have to know it, then you could as well exchange the message itself. If you use the key repeatedly, then you can crack it - I think.
 
  • #12
Baluncore said:
OTPs do not work for large data volumes. The OTP fails when those responsible for generating the pads become overworked, or get lazy, and reuse earlier random data in some way.
Human error is always implied in any encryption scheme. Recall the many errors german operators made when using enigma.

Some were slight habits using their girlfriends name while others were blatant retransmission in the clear of a prior encrypted message.
 
  • #13
fresh_42 said:
but is it more difficult than that?
I think so, yes
fresh_42 said:
If you use the key only once and both have to know it, then you could as well exchange the message itself. If you use the key repeatedly, then you can crack it - I think.
Probably? Possibly? Likely? Not sure.
 
  • #14
phinds said:
Probably? Possibly? Likely? Not sure.
Well, I suggested two possible attacks. If both have to know the same key, then this is the point of attack. Others mentioned the human factor. At least, it's significantly constraining its usability. If both parties have to know the key, then you can as well use the not-so-secret random key directly.

What is left if you strip those unnecessary things like Hex code?
 
  • #15
If I understand correctly, the plan is to send the message and the key together, interleaved in some secret way. That means that the interesting bit is how you did the interleaving, which you didn't specify.

If that's predictable or stealable, you're in serious trouble.
 
  • #16
phinds said:
Hm ... seems to me the XORing removes it from the realm of Ceasar codes, no?
No. What makes a Caesar code a Caesar code is that there is a position-dependent one-to-one mapping from each character of plaintext to each character of ciphertext. Simple substitution ciphers (like newspaper cryptogram puzzles) are the special case where the function is the same in all positions; the original Caesar cipher added modulo 26 a position-dependent constant to the plaintext; xoring a position-dependent constant is just a different function more natural with computers.
 
  • #17
Swamp Thing said:
Eve has no information at all except the messages that Alice transmits to Bob. Can she deduce the scheme and decrypt a corpus of messages?
The standard approach to generating encryption schemes is to use trapdoor functions: easy to encode, difficult to decode without additional information. Transmitting this critical information, whichever it is disguised as, is a serious vulnerability because it can be directly attacked. You must ensure that eavesdropping doesn't generate an advantage.
 
Last edited:
  • Like
Likes Swamp Thing and jedishrfu
  • #18
Swamp Thing said:
Alice generates a random series of digits that define a key 0 < K < 1, using a physics based, nearly perfect random generator. She then calculates exp( Pi * K) / 4, or some such irrational number.
This original series of digits. Is it finite?

If the original key is finite then one should instead use a cryptographically strong keyed hash to generate a stream for a stream cipher.

If the original key is an unending stream then one has taken one cryptographically random key stream and transformed it to what one hopes is a new cryptographically random key stream. What is the point?

You've also introduced bias in the first digit in the output stream.

Then too, one needs infinite precision arithmetic and a willingness to deal with something like ##n^2## performance demands.
 

Similar threads

Replies
5
Views
2K
Replies
7
Views
3K
Replies
7
Views
3K
Back
Top