分享java帶來的快樂

          我喜歡java新東西

          AES加密是key的字節(jié)數(shù)

          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 強(qiáng)強(qiáng) 閱讀(8612) 評論(0)  編輯  收藏 所屬分類: Java

          主站蜘蛛池模板: 平乡县| 桐乡市| 巧家县| 通渭县| 信丰县| 玉溪市| 富蕴县| 大名县| 凌海市| 丰镇市| 大城县| 林周县| 利川市| 射阳县| 普兰县| 武陟县| 泽州县| 焦作市| 清原| 马鞍山市| 万荣县| 襄城县| 油尖旺区| 洛宁县| 宣武区| 北宁市| 金乡县| 读书| 房山区| 昔阳县| 神池县| 扎兰屯市| 上杭县| 兴山县| 晋宁县| 东源县| 河津市| 阿瓦提县| 普洱| 江口县| 南陵县|