2013-05-07 89 views

回答

6

根据Java Cipher API

Every implementation of the Java platform is required to support the following standard Cipher transformations with the keysizes in parentheses: 


    AES/CBC/NoPadding (128) 
    AES/CBC/PKCS5Padding (128) 
    AES/ECB/NoPadding (128) 
    AES/ECB/PKCS5Padding (128) 
    DES/CBC/NoPadding (56) 
    DES/CBC/PKCS5Padding (56) 
    DES/ECB/NoPadding (56) 
    DES/ECB/PKCS5Padding (56) 
    DESede/CBC/NoPadding (168) 
    DESede/CBC/PKCS5Padding (168) 
    DESede/ECB/NoPadding (168) 
    DESede/ECB/PKCS5Padding (168) 
    RSA/ECB/PKCS1Padding (1024, 2048) 
    RSA/ECB/OAEPWithSHA-1AndMGF1Padding (1024, 2048) 
    RSA/ECB/OAEPWithSHA-256AndMGF1Padding (1024, 2048) 

因此,它应该支持PKCS5Padding

+0

坦的响应,但是能否请你说的是AES和DES和DESede的尊重,其实我想发送加密数据到支持标准DES算法的设备,我不知道我应该使用哪种模式,它与标准算法实现(CBC模式) – Areff 2013-05-07 10:33:34

+1

关于使用哪种算法,常规DES只有56位密钥,所以应该使用DESede(3DES)。 AES是一个不同的算法,如果你的设备不支持你不应该使用它:)关于模式,由于ECB不安全,CBC模式是通过ECB执行的。关于不同模式的很好的描述可以在[Wiki页面]找到(http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation) – 2013-05-07 10:57:17