aboutsummaryrefslogtreecommitdiff
path: root/internal/crypt
diff options
context:
space:
mode:
Diffstat (limited to 'internal/crypt')
-rw-r--r--internal/crypt/mem.go5
-rw-r--r--internal/crypt/rawDecrypt.go2
-rw-r--r--internal/crypt/rawEncrypt.go2
3 files changed, 4 insertions, 5 deletions
diff --git a/internal/crypt/mem.go b/internal/crypt/mem.go
index 9c1d21c..753d717 100644
--- a/internal/crypt/mem.go
+++ b/internal/crypt/mem.go
@@ -1,8 +1,7 @@
package crypt
import (
- "fmt"
- "os"
+ "log"
"syscall"
)
@@ -11,6 +10,6 @@ func TryMlock(b []byte) {
return
}
if err := syscall.Mlock(b); err != nil {
- fmt.Fprintf(os.Stderr, "mlock warning: %v\n", err)
+ log.Fatalf("mlock: %v", err)
}
}
diff --git a/internal/crypt/rawDecrypt.go b/internal/crypt/rawDecrypt.go
index d1f0193..6cfea1f 100644
--- a/internal/crypt/rawDecrypt.go
+++ b/internal/crypt/rawDecrypt.go
@@ -39,7 +39,7 @@ func DecryptBytesPass(inputBytes []byte, password []byte) ([]byte, error) {
return nil, fmt.Errorf("decrypt: expected password auth, got %s", headers.Auth)
}
- key := argon2.IDKey(password, headers.Salt[:], 1, 2*1024*1024, 2, 32)
+ key := argon2.IDKey(password, headers.Salt[:], 1, 64*1024*1024, 2, 32)
TryMlock(key)
defer clear(key)
aead, err := chacha20poly1305.New(key)
diff --git a/internal/crypt/rawEncrypt.go b/internal/crypt/rawEncrypt.go
index 03f742f..a138753 100644
--- a/internal/crypt/rawEncrypt.go
+++ b/internal/crypt/rawEncrypt.go
@@ -22,7 +22,7 @@ func EncryptBytesPass(inputBytes []byte, password []byte) ([]byte, error) {
headers := FileHeaders{Salt: salt, Nonce: nonce, Type: File, Parts: 1, Auth: Pass, Recipients: []WrappedKey{}}
- key := argon2.IDKey(password, headers.Salt[:], 1, 2*1024*1024, 2, 32)
+ key := argon2.IDKey(password, headers.Salt[:], 1, 64*1024*1024, 2, 32)
TryMlock(key)
defer clear(key)
aead, err := chacha20poly1305.New(key)