Encryption and/ as file compression

  • Thread starter Edi
  • Start date
  • #1
Edi
177
1

Main Question or Discussion Point

Im not exactly sure how encryption works, but, I think, it basically just scrables the alphabet, if you will. So somthing like "dusk" would become "ftjo" if red withot the decryption key. (of course, it is more complicated and in binary, but still..) Right?

So.. if so, and if encryption keyy is generated randomly, is there a chance that something like "dusk" would actually read as "dawn" when scrabbled?

Assuming that this is at least somewhat correct, I will ask this: is it possible to use this effect in our advantage?
By making the encryption key not-random, by calculating what encyption key would be necessary for an existing file to be red as something completely else, but readable, when red with the key and creating/ saving the key instead of the new file we want to save?
How large could that kind of key be, if possible at all?
/brainstorm
 

Answers and Replies

  • #2
jhae2.718
Gold Member
1,161
20
Modern cryptography is based heavily on Shannon's information theory.

Basically, there are two main principles: confusion and diffusion. Confusion is the scrambling most people think off, while diffusion aims to make the frequency distribution of ciphertext as uniform as possible.

There is an information-theoretic secure cipher called a one-time pad which XORs (or adds modulo 26 if you're doing it by hand) a true random key with the plaintext to produce ciphertext. You can only use a key to encrypt a single message. Theoretically, every possible key is equally likely and thus any ciphertext could be the result of arbitrary plaintext. (You might ask why one-time pads aren't used all over the place. The answer is that, in practice, they're almost impractical to use. Also, defining what a truly random key is is not a trivial task. And, if you reuse a key it is trivial to extract both messages.)

What you're describing is something that comes up every now and then when discussing plausible deniability. The idea is that, having two possible decryptions, one can be the actual message and the other a "duress" message that would be less sensitive/condemning, though still enough not to arouse suspicion. This is trivially easy with a one time pad. Simply write your "duress" message and XOR it with the ciphertext. The result is your fake key.

In the end, for most use cases it turns out that this is probably not necessary. Modern cryptography is very, very good, and is perhaps the strongest link of the security "chain". We are in fact much better at the mathematics and algorithms of cryptosystems than we are at actually implementing them. "Side channel attacks" like recording the times it takes to complete processor operations or the power usage of a machine can allow an attacker to get at a message with considerably less effort than actually breaking the cipher. Additionally, software has bugs that may leak key information or that may have even been backdoored to record encryption keys -- very few people check, or even know to check, their software to see if it's been tampered with.
 
  • #3
Edi
177
1
To be clear, I dont want it to be crypted (secure) and compressed. Im just interested if files can be stored that way (compressed) and how large would that key be. .. for, you know, compressing information on storage devices.
 
  • #4
jhae2.718
Gold Member
1,161
20
I don't see any benefit over conventional compression algorithms. I mean, theoretically you probably could, but why?
 
  • #5
phinds
Science Advisor
Insights Author
Gold Member
2019 Award
16,176
6,179
To be clear, I dont want it to be crypted (secure) and compressed. Im just interested if files can be stored that way (compressed) and how large would that key be. .. for, you know, compressing information on storage devices.
Compression has nothing to do with encryption. Compressed files can be encrypted or not. Compression does not use a "key" so much as it just uses a compression algorithm. Google "Huffman encoding" for example.
 
  • #6
Edi
177
1
I know compression does not use key, but, I guess, im not talking about usual compression. First responce, about "duress" mesage, got the idea.
 
  • #7
Edi
177
1
I don't see any benefit over conventional compression algorithms. I mean, theoretically you probably could, but why?
Well, I was thinking something along the lines of this:
If you can actually have any sequence of bits (1 and 0) red as usable information/ file using a specific key, then you could create a file system where the only information that is saved on memory module is - length of the sequence to be generated[*] and the key.
[*] The sequence would be pre-programmed in OS, a simple binary counting system, for example, which could be generated as long as needed. Telling to generate 1 TB would take mere 104 + a few bits marking the start and end of command.
The key would be made when file is created.

.. how large could that kind of key be for a file of x size?
 
  • #8
rcgldr
Homework Helper
8,690
521
Normally files that are compressed and encrypted are compressed first then encrypted. Part of the point of encryption is to make the compressed data appear more "random" which would interfere with compression algorithms. As mentioned above, compression doesn't use a "key", although it may include a "huffman" encoding table. For example, wiki includes an article on "deflate" compression algorithm:

http://en.wikipedia.org/wiki/DEFLATE
 
  • #9
Edi
177
1
Normally files that are compressed and encrypted are compressed first then encrypted. Part of the point of encryption is to make the compressed data appear more "random" which would interfere with compression algorithms. As mentioned above, compression doesn't use a "key", although it may include a "huffman" encoding table. For example, wiki includes an article on "deflate" compression algorithm:

http://en.wikipedia.org/wiki/DEFLATE
Well, yes, but what I am talking about is a theoretical new system. It is described above.
A key could be used to read string of bits, that are generated by computer. (binary counting string or something else, that any computer can generate as long as needed)
 
  • #10
188
1
I doubt whether key length would be the issue; what you're describing would effectively be finding a "Shakespeare's Monkey" key for a conventional encryption algorithms (I also doubt that a 'universal' key would be possible). It would probably require a new encryption algorithm that would, say, have to ensure that the result was a proper English (Russian, Chinese, German, Latin, whatever) sentence.
 

Related Threads on Encryption and/ as file compression

  • Last Post
Replies
5
Views
571
Replies
3
Views
2K
  • Last Post
Replies
6
Views
5K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
2
Views
5K
  • Last Post
Replies
7
Views
2K
Replies
3
Views
864
  • Last Post
Replies
7
Views
2K
Replies
4
Views
2K
Replies
9
Views
541
Top