for example: if we have public key : (5,221) and private key : (77,221) and we want to encrypt 1:
c(m) = (m)^p mod n c(m)=(1)^77 mod 21 =1
so how to deal with that? is there some work around ?
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It only takes a minute to sign up.Sign up to join this community
The algorithm you quote is usually called textbook RSA and is not used in practice for numerous security reasons (the problem you pointed out, is just one of them).
In practice, you have to pad (or armor) your message. This should be done using the RSA-OAEP (also called PKCS#1 v2.0) scheme. It transforms your message (1) into a pseudorandom block (not 1) which is then processed by the RSA encryption.