File tree 2 files changed +18
-17
lines changed
2 files changed +18
-17
lines changed Original file line number Diff line number Diff line change @@ -58,12 +58,12 @@ echo "password123456" | safelock-cli encrypt path_to_encrypt encrypted_file_path
58
58
59
59
func main () {
60
60
lock := safelock.New ()
61
- inputPath := " /home/testing/important"
61
+ inputPaths := [] string { " /home/testing/important" }
62
62
outputPath := " /home/testing/encrypted.sla"
63
63
password := " testing123456"
64
64
65
- // Encrypts `inputPath ` with the default settings
66
- if err := lock.Encrypt (nil , inputPath , outputPath, password); err != nil {
65
+ // Encrypts `inputPaths ` with the default settings
66
+ if err := lock.Encrypt (nil , inputPaths , outputPath, password); err != nil {
67
67
panic (err)
68
68
}
69
69
@@ -77,31 +77,32 @@ echo "password123456" | safelock-cli encrypt path_to_encrypt encrypted_file_path
77
77
78
78
### Performance
79
79
80
- With the default settings it should be about ** twice ** as fast as ` gpgtar `
80
+ With the default settings it should be about ** three times ** faster than ` gpgtar `
81
81
82
82
``` shell
83
83
> du -hs testing/
84
84
1.2G testing/
85
85
86
- > time gpgtar --encrypt --output testing.gpg -r user testing/
87
- real 0m42.710s
88
- user 0m41.148s
89
- sys 0m7.943s
86
+ > time gpgtar -e -o testing.gpg -c --yes --batch --gpg-args " --passphrase testing123456" testing/
87
+ real 0m40.141s
88
+ user 0m33.933s
89
+ sys 0m6.930s
90
+
90
91
91
92
> time echo " testing123456" | safelock-cli encrypt testing/ testing.sla --quiet
92
- real 0m20.697s
93
- user 0m25.355s
94
- sys 0m9.647s
93
+ real 0m8.403s
94
+ user 0m10.790s
95
+ sys 0m4.832s
95
96
```
96
97
97
98
> [ !TIP]
98
- > You can get even faster performance using the ` --sha256 ` flag (less secure)
99
+ > You can get slightly better performance using the ` --sha256 ` flag (less secure)
99
100
100
101
``` shell
101
102
> time echo " testing123456" | safelock-cli encrypt testing/ testing.sla --quiet --sha256
102
- real 0m16.043s
103
- user 0m17.550s
104
- sys 0m8.707s
103
+ real 0m8.188s
104
+ user 0m10.441s
105
+ sys 0m4.709s
105
106
```
106
107
107
108
And no major file size difference
Original file line number Diff line number Diff line change @@ -23,9 +23,9 @@ type Safelock struct {
23
23
KeyLength int
24
24
// nonce length used to generate the encryption key (default: 12)
25
25
NonceLength int
26
- // encrypted/decrypted files buffer size (default: 4096 )
26
+ // encrypted/decrypted files buffer size (default: 64 * 1024 )
27
27
BufferSize int
28
- // encryption/decryption channels buffer size increasing/decreasing it might improve performance (default: 5 )
28
+ // encryption/decryption channels buffer size increasing/decreasing it might improve performance (default: 30 )
29
29
ChannelSize int
30
30
// minimum password length allowed (default: 8)
31
31
MinPasswordLength int
You can’t perform that action at this time.
0 commit comments