javax.crypto.BadPaddingException: unknown block type
问题 I am trying to simulate asymmetric key system. I use following code to generate key pairs, encrypt, decrypt passwords. I have a distributed environment and for the moment I save the keys generated in a file system. I know that is not secure but its just for testing purposes. private static SecureRandom random = new SecureRandom(); static { Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider()); } protected synchronized void generateKeys() throws InvalidKeyException,