I\'m looking for a Java sample how to do RSA Encryption with a given public key (I have it in base64 format, seems it is 1024 bit length).
Below is
Your public key does not look like a Base64 encoded 1024 bit value. A 1024 bit value would require 172 characters (the last one being a filler =) and here we have 175 chars.
For a test, replace the last four characters in your String with a single = and test if this eliminates the exception. This won't solve the problem but may point in correct direction.