密码策略
Setting up Password Strategy
关于此功能
/** 自定义加解密方法,请勿修改public String encrypt(String strToEncrypt)、public String decrypt(String strToDecrypt)
/** 请将依赖一并打包上传
/** Customized encryptor implementation with decryptor and encryption method.. */
public class Main {
/**
* Encrypt
*
* @param strToEncrypt Original string to encrypt
* @return Encrypted string.
*/
public String encrypt(String strToEncrypt) {
return "@@@" + strToEncrypt;
}
/**
* Decrypt.
*
* @param strToDecrypt Encrypted string to decrypt.
* @return Decrypted string.
*/
public String decrypt(String strToDecrypt) {
if (strToDecrypt.length() > 3 && "@@@".equals(strToDecrypt.substring(0, 3))) {
return strToDecrypt.substring(3);
} else {
throw new IllegalArgumentException("Illegal string input");
}
}
}
/** 自定义解密方法,请勿修改public String encrypt(String strToEncrypt)、public String decrypt(String strToDecrypt)
/** 请将依赖一并打包上传
/** Customized encryptor implementation with only decryptor method. */
public class Main {
/**
* Encrypt
*
* @param strToEncrypt Original string to encrypt
* @return Encrypted string.
*/
public String encrypt(String strToEncrypt) {
return strToEncrypt;
}
/**
* Decrypt.
*
* @param strToDecrypt Encrypted string to decrypt.
* @return Decrypted string.
*/
public String decrypt(String strToDecrypt) {
if (strToDecrypt.length() > 3 && "@@@".equals(strToDecrypt.substring(0, 3))) {
return strToDecrypt.substring(3);
} else {
throw new IllegalArgumentException("Illegal string input");
}
}
}操作步骤
注意事项
最后更新于
这有帮助吗?