-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_test.go
55 lines (45 loc) · 2.1 KB
/
main_test.go
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//
// Copyright (c) 2023 Joel Strasser <[email protected]>
//
// Licensed under the EUPL-1.2 license.
//
// For the full license text consult the 'LICENSE' file from the repository.
//
package main
import (
"enka/enka_decryption"
"enka/enka_encryption"
"testing"
)
func TestDefaultEncryption(t *testing.T) {
args := []string{"--algo", "aes256cbc", "--kdf", "pbkdf2:650000:sha256", "--key", "1234", "--text", "abcd"}
enka_encryption.Encrypt(args, nil, nil)
}
func TestDefaultDecryption(t *testing.T) {
args := []string{"--string", "%enka%v1%aes256cbc%pbkdf2:650000:sha256%rhGye/PFC9U=%GiGjGRW2BrQxYdiY69Dstg==%BVeCM81SXQqSwVuMjRyIIQ==", "--key", "1234"}
enka_decryption.Decrypt(args, nil, nil)
}
func TestAes192CbcArgon2IdDefaultEncryption(t *testing.T) {
args := []string{"--algo", "aes192cbc", "--kdf", "argon2id:1:65536:4", "--key", "1234", "--text", "abcd"}
enka_encryption.Encrypt(args, nil, nil)
}
func TestAes192CbcArgon2IdDefaultDecryption(t *testing.T) {
args := []string{"--string", "%enka%v1%aes192cbc%argon2id:1:65536:4%2eUjGF4/s1w=%gDZyDGfCwaX8y45D8heutQ==%tGwbFcnfIWDZkGvtWdCffQ==", "--key", "1234"}
enka_decryption.Decrypt(args, nil, nil)
}
func TestAes128CbcPbkdf2Iter20Sha512256Encryption(t *testing.T) {
args := []string{"--algo", "aes128cbc", "--kdf", "pbkdf2:20:sha512/256", "--key", "1234", "--text", "abcd"}
enka_encryption.Encrypt(args, nil, nil)
}
func TestAes128CbcPbkdf2Iter20Sha512256Decryption(t *testing.T) {
args := []string{"--string", "%enka%v1%aes128cbc%pbkdf2:20:sha512/256%13RKiPraGzc=%acl2D57zwrHrMm7xb72ZZg==%XYT8Dt8WedI9ZpBE51l0MA==", "--key", "1234"}
enka_decryption.Decrypt(args, nil, nil)
}
func TestCamellia128Pbkdf2Iter20Sha512256Encryption(t *testing.T) {
args := []string{"--algo", "camellia128", "--kdf", "pbkdf2:20:sha512/256", "--key", "1234", "--text", "abcd"}
enka_encryption.Encrypt(args, nil, nil)
}
func TestCamellia128Pbkdf2Iter20Sha512256Decryption(t *testing.T) {
args := []string{"--string", "%enka%v1%camellia128%pbkdf2:20:sha512/256%GP0ocCWcyZ8=%FvaDgjC721byH3EEGBBk8Q==%gnL9Ssd8JWObUppVnhmATA==", "--key", "1234"}
enka_decryption.Decrypt(args, nil, nil)
}