a 10-bit hash has 2^10 possible values, which is 1,024a 1,048,576 bit message has 2^ 1,048,576 different possibilities.
So there are 2^1,048,576 divided by 2^10 messages that hash to the same value. To divide you subtract exponents, so there are 2^1,048,566 messages that hash to the same value. Another way to look at it, is that no matter what the message length, there is one chance in a thousand that a second message will have the same hash. Typically you want to use a 32 or 64 bit hash to bring the chance of collision down to one in 4 billion or one in 16 billion billion. That's usually good enough for most purposes.
Answer 2
Get out your decoder wheel and set it for A = O. Oh wait we need a function... Hmmm... maybe the inverse of the given function? I'm just sort of guessing here. After all, I've never attended any big university classes that discussed ciphers. What type of cipher is it? Well, that really depends on what book you are using. This cipher has several names and some of them are technically incorrect though commonly found in texts. It might even be related to some guy named Caesar though that cipher traditionally uses an offset of 3..
- RSA is a public key system, i.e. a public key is used for encrypting. But a private key must be known for deciphering. So anyone, essentially, can encrypt. But only cognoscenti can decrypt.
- Plaintext is encrypted in blocks.
- Each block is upper-bounded by a numeric value n. This means that block size is
= log2(n). (Why? n = 7 gives binary value 111. log2 7 < 3 since log28 = 3.)
- In practice, block size is 2k bits with 2k < n = 2k+1.
- Plaintext block: M
- Ciphertext block: C
- C = Me mod n
- M = Cd mod n = (Me)d mod n = Med mod n
- Both sender and receiver know the value of n.
- Sender knows the value of e.
- Receiver knows the value of d.
- So:
Public key = {e, n}
Private key = {d, n}
- Note on right hand term of expression for M above: