My application has Java and .NET clients, and my application is in .NET. My clients will send me an XML file encrypted using the RSA public key, and I need to decrypt it using .NET.
In the "Achinth Anand Gurkhi" line, the Java RSA Encryption method generates the following encrypted line:
e8s2Ap3R1AwoaKB7OPCwkf0vhAVGaQisdoq2Yo0BvwcQ7v3oVtMOVc5wsnIyNVOSZV543imwIiBer0HSXRe8PoBD4jj0tTxtLA+bdoR40oQJD2UmZ4OpAH3g92wLXYd4bVvjllcCPPc0tSr/nzEKeZHcnhf6cGpuwfKyFNbXW2vtlEfmRd+LGqlixPRlx1OnsSMNNw+u/5IBs8MauY4Uwq1Lovlgd9f/8WTOvq9ityr84vGLMRGs4wpC7+fFNk8jGuNZgoCDLZw2RqrUd8FBFvN2wCRZXnS7Wg4QjiBdmnq0OsAwK9OFwqnil7DNnDnlytlecR5oYkDhO2fC4FzFiA==
For the same string, the .NET RSA Encryption method generates the following encrypted string with the same public key used by the Java program:
iJO4hwhXGX27jzK87X9gxzzbKpgf7FKhe6UcY7eoiCpLskOatgCMZTm0aTDuwRZGJGbZCIZt+JI9X8LxwOLmIbv5LGyDq+a8jkrPu+pDRvg2uRuKeQj2yBRcp36X+xFf61ux24NaX2RTCY9YfJcUis9NjEkL0eQ3gC79xO0vuBjaUA2oYOt0Mlr7DmKE+b0lz25J/WJuSW83g2oZOlvJ4RnsrFChu0vHnkHCQo9JVjhMc+Onj7+lbI1CDgGq4XigZrHt+j564y3sc3z0oQYfdZkF3yUZrzd3sJjd9KmryHf52eVb9/qgL2/Za1jUwTzKIOvtG/bQpR2ka7Qu1ZqbxQ==
But my .NET decryption method using the corresponding private key is able to decrypt both back to the same line of “Achinth Anand Gurkhi”. How is it possible that different encrypted strings return the same value?
source
share