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

  • Thread starter Thread starter Swamp Thing
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around a proposed encryption scheme involving a key generated from a random series of digits and the use of XOR operations to encrypt messages. Participants explore the security implications of the scheme, potential vulnerabilities, and methods an expert might use to crack it. The conversation touches on theoretical aspects of cryptography, practical cryptanalysis, and historical examples of encryption failures.

Discussion Character

  • Debate/contested
  • Technical explanation
  • Conceptual clarification
  • Exploratory

Main Points Raised

  • Some participants argue that the encryption scheme relies on keeping the protocol secret, which may not be sufficient for security.
  • Others suggest that practical cryptanalysis could involve methods such as theft of clear text or social engineering tactics.
  • A participant mentions the one-time pad (OTP) as a theoretically secure method but notes its practical weaknesses, such as key reuse and human error.
  • There is a discussion about the potential for frequency analysis and brute force attacks on fixed keys, with some likening the scheme to a modern version of a Caesar cipher.
  • Concerns are raised about the complexity and potential errors in the proposed scheme, suggesting it may be prone to mistakes during implementation.
  • Some participants express uncertainty about the effectiveness of the encryption, questioning whether it is more secure than simpler methods.
  • There is mention of the importance of key generation and distribution in maintaining security, with references to historical encryption failures.
  • A participant highlights the need for clarity on how the key is interleaved with the message, suggesting that predictability could lead to vulnerabilities.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the security of the proposed encryption scheme. Multiple competing views exist regarding its vulnerabilities, the effectiveness of various cryptanalytic techniques, and the implications of human error in encryption practices.

Contextual Notes

Limitations include the dependence on the secrecy of the protocol and the assumptions regarding the strength of the random number generator used for key creation. The discussion also highlights unresolved issues related to the complexity of the encryption process and the potential for errors in implementation.

Swamp Thing
Insights Author
Messages
1,047
Reaction score
786
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   Reactions: 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.
 
  • Like
Likes   Reactions: jedishrfu
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   Reactions: 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.
 
  • Agree
Likes   Reactions: phinds
  • #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   Reactions: 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.
 
  • Like
Likes   Reactions: Nugatory

Similar threads

  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 7 ·
Replies
7
Views
4K