分享java帶來的快樂

          我喜歡java新東西

          AES加密是key的字節數

          Exception in thread "main" java.security.InvalidKeyException: Invalid AES key length: 6 bytes
          at com.sun.crypto.provider.AESCipher.engineGetKeySize(DashoA13*..)
          at javax.crypto.Cipher.b(DashoA13*..)
          at javax.crypto.Cipher.a(DashoA13*..)
          at javax.crypto.Cipher.a(DashoA13*..)
          at javax.crypto.Cipher.a(DashoA13*..)
          at javax.crypto.Cipher.init(DashoA13*..)
          at javax.crypto.Cipher.init(DashoA13*..)
          at AES.main(AES.java:48)

          The problem is surely with the length of the key, I have tried different length but I am getting the same, could you please tell me the length of the key please, I am new to cryptography, I have made some research but still can't figure out the problem. Thanks a lot for your answers.

           
          AES supports 128, 192 and 256 bit keys, so the number of bytes needs to be 16, 24, or 32. Note that the latter two may not be available in all circumstances (as the comment in the "kgen.init(128)" line mentions). 

          posted on 2011-07-26 21:56 強強 閱讀(8612) 評論(0)  編輯  收藏 所屬分類: Java

          主站蜘蛛池模板: 水城县| 平果县| 革吉县| 泸定县| 天津市| 星子县| 昌邑市| 扎兰屯市| 正定县| 陕西省| 长武县| 湘乡市| 阿拉善右旗| 株洲县| 阿拉善盟| 渭源县| 长葛市| 介休市| 龙川县| 通辽市| 大关县| 宁国市| 紫阳县| 锡林浩特市| 基隆市| 榆树市| 河南省| 梁平县| 房产| 包头市| 佳木斯市| 花垣县| 若尔盖县| 江孜县| 水城县| 错那县| 兴海县| 盐源县| 应城市| 溧阳市| 灵石县|