FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
AES4ObjC-Java-JavaScript/Java/src/Tester.java at master · Herbert8/AES4ObjC-Java-JavaScript · GitHub
Herbert8
AES4ObjC-Java-JavaScript
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
AES4ObjC-Java-JavaScript
/
Java
/
src
/
Tester.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
34 lines (24 loc) · 1.22 KB
Breadcrumbs
AES4ObjC-Java-JavaScript
/
Java
/
src
/
Tester.java
Copy path
File metadata and controls
executable file
·
34 lines (24 loc) · 1.22 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//
// https://github.com/WelkinXie/AESCipher-Java
//
import
java
.
io
.
UnsupportedEncodingException
;
import
java
.
security
.
InvalidAlgorithmParameterException
;
import
java
.
security
.
InvalidKeyException
;
import
java
.
security
.
NoSuchAlgorithmException
;
import
javax
.
crypto
.
BadPaddingException
;
import
javax
.
crypto
.
IllegalBlockSizeException
;
import
javax
.
crypto
.
NoSuchPaddingException
;
public
class
Tester
{
public
static
void
main
(
String
[]
args
)
throws
InvalidKeyException
,
NoSuchAlgorithmException
,
NoSuchPaddingException
,
UnsupportedEncodingException
,
InvalidAlgorithmParameterException
,
IllegalBlockSizeException
,
BadPaddingException
{
System
.
out
.
println
(
">>>>>>>>>>> 测试开始……"
);
final
String
plainText
=
"abc`~!@#$%^&*()_+-=':;<>?,./|{}[]
\\
\"
xyz123中文"
;
final
String
key
=
"16BytesLengthKey"
;
System
.
out
.
println
(
"原始字符串:"
+
plainText
);
System
.
out
.
println
(
"秘钥:"
+
key
);
String
string
=
AESCipher
.
aesEncryptString
(
plainText
,
key
);
System
.
out
.
println
(
"加密后得到的 Base64 字符串:"
+
string
);
String
decryptedText
=
AESCipher
.
aesDecryptString
(
string
,
key
);
System
.
out
.
println
(
"解密后得到的字符串:"
+
decryptedText
);
System
.
out
.
println
(
"<<<<<<<<<<< 测试结束!"
);
}
}
Back
|
FazBrowse Home
|
New Git URL