summaryrefslogtreecommitdiff
path: root/cmd/goaes/commands
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/goaes/commands')
-rw-r--r--cmd/goaes/commands/commands.go3
-rw-r--r--cmd/goaes/commands/decrypt.go2
-rw-r--r--cmd/goaes/commands/encrypt.go2
3 files changed, 5 insertions, 2 deletions
diff --git a/cmd/goaes/commands/commands.go b/cmd/goaes/commands/commands.go
new file mode 100644
index 0000000..f7086a9
--- /dev/null
+++ b/cmd/goaes/commands/commands.go
@@ -0,0 +1,3 @@
+package commands
+
+const fileMode = 0600
diff --git a/cmd/goaes/commands/decrypt.go b/cmd/goaes/commands/decrypt.go
index 8f73c42..1912c1a 100644
--- a/cmd/goaes/commands/decrypt.go
+++ b/cmd/goaes/commands/decrypt.go
@@ -39,7 +39,7 @@ func Decrypt(ctx context.Context, cmd *cli.Command) error {
return err
}
- err = os.WriteFile(destination, plaintext, 0666)
+ err = os.WriteFile(destination, plaintext, fileMode)
if err != nil {
return err
}
diff --git a/cmd/goaes/commands/encrypt.go b/cmd/goaes/commands/encrypt.go
index 47809c4..c658780 100644
--- a/cmd/goaes/commands/encrypt.go
+++ b/cmd/goaes/commands/encrypt.go
@@ -32,7 +32,7 @@ func Encrypt(ctx context.Context, cmd *cli.Command) error {
return err
}
- err = os.WriteFile(destination, dataBuffer.Bytes(), 0666)
+ err = os.WriteFile(destination, dataBuffer.Bytes(), fileMode)
if err != nil {
return err
}