我在java类中遇到解密错误:
javax.crypto.IllegalBlockSizeException :
Input length must be multiple of 16 when decrypting with padded cipher.
Run Code Online (Sandbox Code Playgroud)
我该怎么做才能解决这个问题?
更新:
我忘了提到它工作一次,当第二次我试图再次执行它时抛出上述错误.
package com.tb.module.service;
import java.security.Key;
import java.security.spec.InvalidKeySpecException;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
import sun.misc.*;
/**
* This class is used for encrypt and decrypt the password field.
*
*/
public class PswdEnc {
private static final String ALGO = "AES";
private static final byte[] keyValue = new byte[] { 'T', 'h', 'e', 'B', 'e', 's', 't','S', 'e', 'c', 'r','e', 't', 'K', 'e', 'y' }; …Run Code Online (Sandbox Code Playgroud) 我只需要允许用户在textinput中输入以下字符:
A-ZA-Z0-9 @#$%^*_!|
<form action="http://www.cknuckles.com/cgi/echo.cgi" method="get" name="logOn">
User Name:<br />
<input type="text" name="userName" size="25" /><br />
Password:<br />
<input type="password" name="pw" size="25" /><br />
<input type="submit" value="Log In" onClick="validate()"/>
</form>
Run Code Online (Sandbox Code Playgroud)
上面是我的HTML,下面是我试图用来验证它的JavaScript - 但它不起作用 - 任何线索.
<script language="javascript">
document.logOn.onsubmit=validate;
function validate(){
var name=document.logOn.pw.value;
if(!name = "[a-zA-Z0-9!@#$%^*_|]"){
alert("Your Password Cant Have any thing other than a-zA-Z0-9!@#$%^*_| - Play It Straight!");
return false;
}
return true;
}
</script>
Run Code Online (Sandbox Code Playgroud)
但这不起作用.我仍然可以把字符放在">","<"和"{"等中.
有什么想法吗?
我想在ColdFusion工作.我正在尝试用本书" Adobe ColdFusion 9 Web应用程序构建工具包,第1卷 - 入门 " 学习ColdFusion
到目前为止,我已达到Page - 350.
无论如何.我想要一个关于作为ColdFusion开发人员的职业生涯的认真建议.
我需要这些问题的答案:( 我真正要问的是什么)
1)掌握ColdFusion需要多长时间?
2)哪些框架最好?
3)ColdFusion还需要哪些其他技术?
4)作为ColdFusion开发人员,您的个人经历是什么?
编辑:
我知道一点点php和Java,当我将它与ColdFusion进行比较时,ColdFusion似乎比php容易十亿倍.这并不是说我不喜欢php,只是说.
由于我有一些Java经验,我认为它可以帮助我进行ColdFusion开发.
一旦我对ColdFusion Development求平均值,我计划学习一门新语言.就像目标C.我不知道ColdFusion和iOS开发是否是一个很好的组合.