News for hackers. Stuff that matters.
Re:Hashing is not encryption by triska on Sunday January 09, 2022 @05:50AM (#29862167)
A cryptographic hash function H can be used for encryption though, by mimicking a one-time pad: Pick a random integer k, concatenate it with a secret s, hash the result obtaining H(s•k), XOR this with the plaintext yielding the ciphertext C and send the pair (k,C). Pick another integer if you need to encrypt more data.

Decryption proceeds in the same way, mutatis mutandis. This is the basic idea behind one of the best currently used ciphers, ChaCha20: It builds on a hash function.

From a regulatory and legal perspective, this means that if you want to ban strong encryption, you must ban cryptographic hash functions.

Re:Hashing is not encryption by ThePhysicist on Sunday January 09, 2022 @09:10AM (#29863349)
Yep we use that to e.g. construct stream ciphers for structure-preserving pseudonymization. Security proof is quite simple as well if you can assume the hash function is secure. No one would use this for encryption though as it's quite slow compared to a modern stream cipher. We use it because there's (to my knowledge) no standardized stream cipher that provides output feedback mode (OFB) out-of-the-box.
Re:Hashing is not encryption by tptacek on Sunday January 09, 2022 @03:06PM (#29866848)
Pretty much everybody uses this for encryption; the most popular stream cipher (qua stream cipher) in the world is Salsa20/ChaCha20, which is simply a keyed hash function run in counter mode.
Re:Hashing is not encryption by ignoramous on Sunday January 09, 2022 @01:49PM (#29866166)
> ...structure-preserving pseudonymization

Can you write about this a bit more, please (what does it mean)? Is it comparable to Tokenization (typically used to hide sensitive-date like credit card details, for example) [0], or to Homomorphic encryption [1]?

[0] https://en.wikipedia.org/wiki/Tokenization_(data_security)

[1] https://people.csail.mit.edu/vinodv/FHE/FHE-refs.html

Re:Hashing is not encryption by ThePhysicist on Monday January 10, 2022 @06:36AM (#29873260)
Tokenization typically means that a third party keeps an association table, though it is possible to generate tokens cryptographically. Homomorphic encryption is something different again, though you could call this structure-preserving pseudonymization homomorphic as it preserves certain structural properties of the input data. It does not provide the same security guarantees as FHE though as the structure preservation weakens the encryption. For pseudonymization this is a tradeoff that can be worthwhile though.
Re:Hashing is not encryption by 0xdeadb00f on Sunday January 09, 2022 @10:51PM (#29870397)
> (to my knowledge) no standardized stream cipher that provides output feedback mode (OFB) out-of-the-box.

I wasn't aware stream ciphers typically had different modes of operation like block ciphers did. Could you expand on this? I'm kind of interested.

Re:Hashing is not encryption by ThePhysicist on Monday January 10, 2022 @06:33AM (#29873234)
OFB means you feed the output of the cipher back to the input. Hence if you have two character sequences that share a prefix e.g. "abc123" and "abcxyz" the first three cipher stream bits will be identical and then deviate based on the feedback the cipher gets (assuming no IV and identical key). This is interesting for pseudonymization when you want to e.g. create cryptographically secure pseudonyms that preserve prefixes (think IP address pseudonyms that preserve subnet groupings).
Re:Hashing is not encryption by freeqaz on Sunday January 09, 2022 @11:19AM (#29864579)
You nerd sniped me with this. At least now I could implement ChaCha from memory... so thanks for that!

It's cool to see how simple it is. It's a lot more intuitive than other ciphers are!

Re:Hashing is not encryption by charlieyu1 on Sunday January 09, 2022 @09:02AM (#29863273)
I’m not even sure that OTP is secure by modern standards. Since OTP encrypts with XOR only, a man-in-the-middle can still modify the message by XOR a few bytes with constants like 0x01 to modify the message.
Re:Hashing is not encryption by DarylZero on Sunday January 09, 2022 @09:57AM (#29863732)
OTP can be combined with some message authentication code, so I don't think that's a fair criticism.
Re:Hashing is not encryption by mistercow on Sunday January 09, 2022 @10:12AM (#29863877)
Yeah, nothing is secure if you apply it incorrectly. SSH isn't secure if you tweet your private key.
Re:Hashing is not encryption by LinuxBender on Sunday January 09, 2022 @12:36PM (#29865456)
One mitigation against this is to specify on the target hosts where that keys are valid from. One could even be as liberal as to give the entire CIDR block of their ISP or Corporate IP CIDR block or preferably use a VPN network. The key will not be valid for anyone not in the specified networks or IP's separated by commas.

e.g. using my tinc VPN mesh

  grep keys /etc/ssh/sshd_config
  AuthorizedKeysFile          /etc/ssh/keys/%u
cat /etc/ssh/keys/root # honeypot server

  from="192.168.0.0/16,10.15.10.2" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDlyvd+LAveSiIIgQW3Y+aWsb8bTu70tgXQjoWMrMAbKt1/sDoE/w2qqLBSqLjJmA46zKqwgZhnO8hkZjpizjb909fNYrgyNOsRcHOvumanORUGjcumxi5fklqNZCXC1rehX4z+tnVzygtDNQcqlmyy1ElBM+SxKS+YIrOymPOU6bc5V1sildq5cVUSuEHcLggOadCj6azbiR1J46D6UYxAaKYjq2OloLZXRhvSYrmVeH+PNKiShgYBu4TfCg4UoJKZsHTaeS2akZAQTqcjy7bB8HRWGXYEMKAKA95w8MTqaWlIoMKBuOJnd8+wRXrZKnSsTQmQQZg0rggO6GC8ufT leaked_on_purpose
I would be happy to provide my private key and a VM IP if anyone would like to try this out.
Re:Hashing is not encryption by xyzzyz on Sunday January 09, 2022 @01:02PM (#29865739)
If you think this is secure even if you leak private key, why not just disable key checking altogether and just allow anyone to log in if they come from accepted network?
Re:Hashing is not encryption by Taek on Sunday January 09, 2022 @01:30PM (#29865978)
Defense in depth - have several independent layers of security so you have some breathing room to fix things if one of the layers is fully compromised.
Re:Hashing is not encryption by LinuxBender on Sunday January 09, 2022 @01:07PM (#29865777)
One could do that as well. Different use cases can mix and match any restrictions using the Match block in sshd_config or simply having a general restriction like this.

  AllowUsers [email protected].*.*
Re:Hashing is not encryption by DarylZero on Sunday January 09, 2022 @02:18PM (#29866426)
Does OpenSSH let you disable all authentication?
Re:Hashing is not encryption by LinuxBender on Sunday January 09, 2022 @02:22PM (#29866464)
Does OpenSSH let you disable all authentication?

Yes one can disable any/all forms of authentication. At that point it might be worth shutting down the SSH daemon to save a few MB of ram. If you mean permit null passwords that can be enabled too.

Re:Hashing is not encryption by DarylZero on Sunday January 09, 2022 @02:32PM (#29866561)
Huh. Neat.

> At that point it might be worth shutting down the SSH daemon

Could be useful with ForceCommand. Sometimes you really only want to authenticate the server -- like with HTTPS.

Re:Hashing is not encryption by LinuxBender on Sunday January 09, 2022 @02:36PM (#29866591)
Good point. That is what I am doing:

  Match Group                     sftpusers
    PubkeyAuthentication            yes
    PasswordAuthentication          yes
    PermitEmptyPasswords            yes
    GatewayPorts                    no
    ChrootDirectory                 /data/sftphome/%u
    ForceCommand                    internal-sftp -l DEBUG1 -f AUTHPRIV -P symlink,hardlink,fsync,rmdir,remove,rename,posix-rename
    AllowTcpForwarding              no
    AllowAgentForwarding            no
Re:Hashing is not encryption by DarylZero on Monday January 10, 2022 @10:05AM (#29875901)
You have `PubkeyAuthentication` and `PasswordAuthentication` both set to `yes`, which is confusing to me. I thought you were saying they were disabled.

When I connect without a `-i` parameter the SSH client attempts to authenticate with all my keys, succeeding with none, then succeeds with authentication type `none`. When I specify -i `/dev/null` the logs are confusing as to what's happening:

    $ ssh -i /dev/null -v [email protected] 2>&1 | egrep -ie 'auth|attempt'
    debug1: Authenticating to 50.116.13.30:22 as 'serveradmin'
    debug1: Will attempt key: /dev/null  explicit
    debug1: Authentication succeeded (none).
    Authenticated to 50.116.13.30 ([50.116.13.30]:22).
I guess what you actually did was not disable authentication methods, but enable empty passwords, and set the account to an empty password -- and SSH does not even ask for the empty password in this case or even call it the same name as password auth in the logs. I guess!?
Re:Hashing is not encryption by LinuxBender on Monday January 10, 2022 @10:37AM (#29876452)
Having both set to yes means you are able to use either. Earlier I mentioned there was the possibility to disable both of them at which point nobody would be able to log in because only keys and passwords are used on that system. That is why I jokingly said you may as well shut down the daemon to save ram. There are methods other than keys and passwords but I have not implemented any of them.

A null password is using none [1] which is a reserved term and has specific implications. In this case of passwords, none will succeed since I enabled null passwords and that account has no password set. So none is matching in the PasswordAuthentication option.

  /etc/passwd  serveradmin:x:22218:5000::/data/sftphome/serveradmin:/bin/false
  /etc/shadow  serveradmin::18955:0:99999:7:::
There is no password hash after the first colon in the shadow entry. This was accomplished with

  usermod -p '' serveradmin
Using -i pass a key file but since I have not added any of your keys to the system then any key you specify will not match and the client will proceed on to the next authentication method you have enabled and have not explicitly disabled in the client. To accept any random key would require a change to the source code of OpenSSH. One can even hard code a public key into OpenSSH in the source code which I have done when configuring OpenSSH as a recovery daemon that does not read or write to the disk.

I hope that helps this make sense. It is understandable that this is confusing because what I am doing is the opposite of what people are instructed to do. Null passwords are considered a security risk unless you do it intentionally for some unorthodox implementation reason which I have done. I have a cron job that adds accounts within some character restrictions that bots try to brute force. I then monitor the bots behavior to see what current bots are attempting over SSH. I do the same for http/https. Both are what is referred to as a low-interaction honeypot.

Here is a bot with IP and port redacted that just tried to use my server as a DNS proxy:

  Connection from 8.37.x.x port x on 50.116.13.30 port 22
  Accepted password for admin from 8.37.x.x port x ssh2
  Changed root directory to "/data/sftphome/admin" [postauth]
  refused local port forward: originator 127.0.0.1 port x,  target 1.1.1.1 port 53 [postauth]
  Received disconnect from 8.37.x.x port x:11: Disconnected on user's request. [postauth]
[1] - https://datatracker.ietf.org/doc/html/rfc4252#page-7
Re:Hashing is not encryption by danlugo92 on Sunday January 09, 2022 @11:15AM (#29864533)
But my private key just laying there unencrypted in `~/.ssh/id_rsa` is safe for some reason??

I've never understood this.

Re:Hashing is not encryption by jamespwilliams on Sunday January 09, 2022 @12:32PM (#29865396)
Smartcards e.g Yubikeys help with this. You store the key on the smartcard, then use ssh-agent to have the smartcard perform whatever cryptographic operations are necessary. On Yubikeys at least, the keys can never leave the smartcard, by design.
Re:Hashing is not encryption by freeqaz on Sunday January 09, 2022 @11:22AM (#29864613)
You should encrypt your private key with a password. Then you can use ssh-agent to hold a copy of that decrypted key in-memory so that you don't have to type your password in every time you 'git push'
Re:Hashing is not encryption by nerdponx on Sunday January 09, 2022 @11:25AM (#29864651)
Is this actually an extra layer of security? Is it harder to get read access to another user's file with 0600 permissions, or to read memory from another user's process? In my limited understanding they seem equivalent (at least on Linux).
Re:Hashing is not encryption by joombaga on Sunday January 09, 2022 @11:53AM (#29864984)
They're approximately equivalent on Linux. Adding a password helps if you accidentally tweet or email your private key, leave it on a flash drive, leave your computer's disk decrypted, etc.
Re:Hashing is not encryption by staticassertion on Sunday January 09, 2022 @12:56PM (#29865675)
It's primarily targeting offline attacks ie: I've stolen your laptop or I am accessing it when you haven't decrypted it.

But there are also niche situations where an attacker has read permissions for files but not memory. It's atypical, but in cases where you have 'confused deputies' it happens - for example, if I have a service that attempts to safely broker reads to files but that service has a logic bug where a client can trick it into reading sensitive files.

The classic example of this is a path traversal in a web service.

Also, while there's no boundary, attackers are a lot happier reading files than memory. They're only human.

In general I find that, when you can, you should just encrypt your data. It can protect you in some surprising ways.

Re:Hashing is not encryption by auxym on Sunday January 09, 2022 @12:21PM (#29865286)
Encrypting the file, or better whole disk encryption, prevents someone stealing the laptop and yanking the drive to get access to everything.
Re:Hashing is not encryption by csunbird on Sunday January 09, 2022 @11:21AM (#29864602)
No, you are supposed to use a passphrase to protect it.
Re:Hashing is not encryption by m-p-3 on Sunday January 09, 2022 @11:55AM (#29865004)
You should always protect your private key(s) with a password.
Re:Hashing is not encryption by tptacek on Sunday January 09, 2022 @03:01PM (#29866803)
Encryption and message authentication are separate problems; the combination of both is called "authenticated encryption". Almost all AE/AEAD schemes ultimately encrypt by simply XOR'ing a keystream against plaintext.
Re:Hashing is not encryption by zarzavat on Sunday January 09, 2022 @03:05PM (#29866837)
"OTP" should not be taken literally here, it's merely an analogy.

Yes, true one-time pad encryption is not secure by modern standards, as you mention there's no authentication, you need a perfect random number source, and key management is horrendous.

However, the concept of encryption by XORing a stream and the plaintext is very much the modern way of doing things, and "OTP" is an analogy for that.

Re:Hashing is not encryption by akerl_ on Sunday January 09, 2022 @03:59PM (#29867280)
“OTP” isn’t an analogy for the concept of XORing a stream. One-time-pad is a specific way of handling key generation.
Re:Hashing is not encryption by zarzavat on Sunday January 09, 2022 @07:01PM (#29868829)
People use it that way.
Re:Hashing is not encryption by akerl_ on Sunday January 09, 2022 @07:27PM (#29869054)
Who? OTP is a one time pad. You’re the first person I’ve ever seen make the claim that it’s an analogy for the concept of xor.
Re:Hashing is not encryption by SavantIdiot on Sunday January 09, 2022 @02:49PM (#29866720)
I believe that's why ChaCha20 is used with Poly1305 to provide authentication, which is why you see it referred to as ChaChaPoly.
Re:Hashing is not encryption by sangel on Sunday January 09, 2022 @12:44PM (#29865551)
I think this requires assuming H is a random oracle, no?

Suppose H(s||k) is a collision-resistant hash function. Let's build another CRHF from H as follows: H'(s || k) = H(s || k) || last-bit-of-k.

Now let's instantiate the cryptosystem you proposed with H'. Suppose m is message and that it is of length equal to the length of the bitstring produced by H'.

We have C = H'(s||k) XOR m.

The ciphertext is thus: (k, C).

What can an attacker do? Well, the attacker can XOR the last bit of C with the last bit of k and get the last bit of m. This is already enough to violate semantic security.

Re:Hashing is not encryption by matthewdgreen on Sunday January 09, 2022 @07:45PM (#29869187)
You're correct that collision resistance is not sufficient for the above construction to be secure, but you don't need to assume H() is a random oracle. You could instead model H(k||s) as a pseudorandom function with k as the key. And of course, if you don't trust existing functions to be directly pseudorandom, then a PRF can be built from one-way functions: so pre-image resistance is sufficient. (The remaining question is how to get there from CR alone.)
Re:Hashing is not encryption by staticassertion on Sunday January 09, 2022 @01:02PM (#29865737)
I don't think they're proposing their implementation is sufficient. ChaCha has a nonce for a reason.
Re:Hashing is not encryption by ris on Sunday January 09, 2022 @07:34AM (#29862707)
The more classic example is probably Feistel ciphers.
Re:Hashing is not encryption by Normal_gaussian on Sunday January 09, 2022 @08:05AM (#29862861)
Which along with other block ciphers are the surprisingly hard to search solution to the problem of providing a bounded, iterable, id that doesnt leak its position of iteration.

(ie, provide an n character id without duplicates and using the entire space. Useful for ids for image hosting etc.)

Re:Hashing is not encryption by SAI_Peregrinus on Sunday January 09, 2022 @12:10PM (#29865170)
Or just CTR mode of a hash function (which is closer to what ChaCha20 does internally, it runs a permutation in CTR mode). H(constant, key, nonce, ctr) gets a keystream block, XOR each keystream block with the corresponding plaintext (to encrypt) or ciphertext (to decrypt) block. The constant is important in ChaCha's case, it keeps the attacker-controlled portion of the block strictly less than half the total block, prevents an all-zero input, and has some asymmetry to help diffusion overall.
Re:Hashing is not encryption by axiosgunnar on Sunday January 09, 2022 @09:10AM (#29863338)
Interesting post but stuff like

> From a regulatory and legal perspective, this means that if you want to ban strong encryption, you must ban cryptographic hash functions.

aka „you can't ban math! ha!“ is just a nerd dream.

The government would simply ban Whatsapp etc from implementing E2E encryption, something that is completely feasible, and 99% of the population‘s communications would be unencrypted.

Re:Hashing is not encryption by sammyq on Monday January 10, 2022 @12:21PM (#29878114)
Why is k an integer, could it be any arbitrary string? Also does k need have some special properties such as primality?
Re:Hashing is not encryption by nathias on Sunday January 09, 2022 @06:19AM (#29862300)
is this unbreakable like OTP?
Re:Hashing is not encryption by triska on Sunday January 09, 2022 @06:27AM (#29862344)
No, because the key stream is not random: It depends functionally on the integer which is sent in plain text, and on the shared secret.

For example, if you pick the same integer twice with the same secret then the XOR of the two ciphertexts is the XOR of the two plaintexts, thus losing confidentiality.

Re:Hashing is not encryption by Karliss on Sunday January 09, 2022 @06:46AM (#29862441)
Neither is OTP secure if you reuse the key. One of main properties of OTP is that an encrypted message could be decrypted to any message of same size. In case of block cyphers and message longer than one block only a fraction of all messages can be obtained. So if you had enough compute resource(and it wasn't more than atoms in universe) for brute force or weakness was found in cyphers you could find which of the potential decrypted messages makes sense and is more likely.
Re:Hashing is not encryption by smitty1e on Sunday January 09, 2022 @07:24AM (#29862646)
> Neither is OTP secure if you reuse the key.

I thought the OT meant "One Time". Reusing the key would take the key from singular to plural usage, no?

Re:Hashing is not encryption by Karliss on Sunday January 09, 2022 @09:27AM (#29863494)
Yes, but I was explaining that no reuse requirement can be equally important for encryption schemes that don't have it included in the name. Claiming that one of them is worse than other because of number reuse even though doing so is equally wrong for both is not a good example.
Re:Hashing is not encryption by pdpi on Sunday January 09, 2022 @09:01AM (#29863268)
Yup, but it’s more useful to talk about that reuse as a bad implementation of one-time pads than it is to call it something other than OTP.

In the classic sense of a small paper pad used by spies, reuse was fairly common because of the logistical problem of supplying agents with fresh pads.

Re:Hashing is not encryption by Closi on Sunday January 09, 2022 @08:08AM (#29862878)
Absolutely - OTP with key reuse is not OTP!
Re:Hashing is not encryption by runeks on Sunday January 09, 2022 @07:02AM (#29862535)
Would it be secure to encrypt a sequence of blocks by having the next integer be H(k) — such that the random integer for block number i is H applied to the original random integer (k) i times? Thus needing only an initial random integer from which all subsequent random integers are derived.
Re:Hashing is not encryption by eternalban on Sunday January 09, 2022 @07:28AM (#29862677)
The general idea is to create a PRNG using the cryptographic hash. Since these hashes generally produce far more bits than needed for scalars (64 bits), you can mix the extra bits for the next cycle of the PRNG and emit (say) 64 bits per cycle. The sequence of the PRNG output is the 'pad'.
Re:Hashing is not encryption by aliceryhl on Sunday January 09, 2022 @09:41AM (#29863616)
No.

With the hash-based algorithm you can go through every possible secret key and starting integer and check whether the result looks like English text (or whatever the contents are). If your English-text check is sufficiently good (how good it has to be decreases with the length of the text), then you're only going to have a very small number of matches, and one of those will be the plain text.

The above attack doesn't work on OTP because the above attack would simply yield a list of all English strings of the given length, and there would be no way to tell them apart.

Obviously the above attack is infeasible because there are too many secrets to check them all in a reasonable amount of time, but to be unbreakable in the same way OTP is, you have to be robust against even attacks that take an infinite amount of time.

Re:Hashing is not encryption by akerl_ on Sunday January 09, 2022 @12:11PM (#29865187)
I’m not sure what you mean by “the above attack would simply yield a list of all English strings of a given length”.

To attack classic OTP, you’d brute force the keyspace. Since we’re XORing, whatever we encode the key as, it’s fundamentally being used in binary to XOR between plaintext and ciphertext. So your key is a binary blob the same length as the ciphertext. You keep trying and looking for what seems to be viable plaintext. You never get “all English strings of the given length”, because you’re not brute forcing the output, you’re brute forcing the key, which isn’t necessarily English.

For the hash-based approach, you’re bruteforcing the secret used for the hash function. That keyspace can be any length, unbounded on either end by the size of the message. Likewise, you’re trying H(sk) by guessing s and k, and then XORing the message and trying to determine if it looks like what you’d expect.

Your lower bound for the hash method is if the message length is shorter than the hash functions output, in which case you can cheat and literally just treat it like classic OTP, by bruteforcing possible values for H(sk) rather than guessing k and running the computation. But beyond that it’s the same dance (and if the hash function is slow, you can always fall back to brute forcing any length message the same way you would for classic OTP).

In both cases, assuming a large key size puts you past computational sanity for brute forcing, but neither the hash construction nor OTP is secure against “infinite” time.

Re:Hashing is not encryption by eperdew on Sunday January 09, 2022 @12:34PM (#29865435)
> To attack classic OTP, you’d brute force the keyspace. Since we’re XORing, whatever we encode the key as, it’s fundamentally being used in binary to XOR between plaintext and ciphertext. So your key is a binary blob the same length as the ciphertext. You keep trying and looking for what seems to be viable plaintext. You never get “all English strings of the given length”, because you’re not brute forcing the output, you’re brute forcing the key, which isn’t necessarily English.

If your key for OTP is uniform random bits without any additional encoding, and of the same length as the plaintext, then won't you enumerate all possible messages of the given length? E.g., "abcdef" and "123456" are indistinguishable when encrypted without knowing the key because there exist keys that map each string to the same ciphertext.

Re:Hashing is not encryption by aliceryhl on Sunday January 09, 2022 @05:34PM (#29868024)
> You never get “all English strings of the given length”, because you’re not brute forcing the output, you’re brute forcing the key, which isn’t necessarily English.

You misunderstand me. If you go through all possible keys and try to decrypt with each key, then for every possible input (of the same length), there will be one of the keys that yield that input. Hence, by going through all keys, you will hit all possible inputs, which includes all strings written in English.

> For the hash-based approach, you’re bruteforcing the secret used for the hash function. That keyspace can be any length, unbounded on either end by the size of the message.

My assumption is that the secret for the hash function input is of fixed length and shorter than the plaintext. This is not an unreasonable assumption — pretty much all existing hash functions satisfy that assumption unless the plaintext is really short.

> In both cases, assuming a large key size puts you past computational sanity for brute forcing, but neither the hash construction nor OTP is secure against “infinite” time.

These algorithms are certainly not computationally feasible, but OTP really is secure against unbounded computation in a way that the hash-based OTP is not. Knowing the ciphertext from an OTP gives literally no information about the original plaintext besides its length.

On the other hand, knowing the ciphertext of the hash-based algorithm must yield some information about the plaintext. To see why, consider an example:

1. The hash function takes as input a secret/integer of a combined 1024 bits. 2. The plaintext and ciphertext is 1000000 bits long.

Here, if you try all possible inputs to the hash function and try to decrypt the ciphertext using each one, then you're going to get a list with 2^1024 possible plaintexts. However, there are 2^1000000 possibilities for what the plaintext could be, so there must be some plaintexts missing from the list. Any plaintext that is missing from the list cannot possibly be the original plaintext.

Re:Hashing is not encryption by akerl_ on Sunday January 09, 2022 @05:43PM (#29868134)
What is an example of a hash function with a fixed length constraint on the input?
Re:Hashing is not encryption by aliceryhl on Monday January 10, 2022 @03:12AM (#29871852)
Ah, yeah, I have mixed up things here a bit. However, the overall points still apply. When people use encryption, they generally don't use secrets anywhere near as long as the plaintext.