mirror of
https://github.com/ZSCNetSupportDept/WechatTicketSystem.git
synced 2025-10-29 16:14:16 +08:00
use RSA to encrypt login
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package love.sola.netsupport.wechat;
|
||||
|
||||
import love.sola.netsupport.util.AESUtil;
|
||||
import love.sola.netsupport.util.RSAUtil;
|
||||
import org.junit.Test;
|
||||
import org.mindrot.jbcrypt.BCrypt;
|
||||
|
||||
@@ -19,9 +19,9 @@ public class TestEncrypt {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAES() {
|
||||
assert "Hello World".equals(AESUtil.decrypt(AESUtil.encrypt("Hello World")));
|
||||
assert "Encrypt".equals(AESUtil.decrypt(AESUtil.encrypt("Encrypt")));
|
||||
public void testRSA() {
|
||||
assert "Hello World".equals(RSAUtil.decrypt(RSAUtil.encrypt("Hello World")));
|
||||
assert "Encrypt".equals(RSAUtil.decrypt(RSAUtil.encrypt("Encrypt")));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user