This commit is contained in:
2025-05-31 10:32:21 -04:00
parent 49c508aae7
commit 5c7c748a69
5 changed files with 13 additions and 11 deletions

View File

@@ -8,8 +8,8 @@ import (
)
func EncryptPassword(b []byte) ([]byte, error) {
nonce := viper.Get("nonce").(string)
dev := viper.Get("device").(string)
nonce := viper.GetString("nonce")
dev := viper.GetString("device")
block, err := aes.NewCipher([]byte(dev))
if err != nil {
@@ -29,9 +29,9 @@ func EncryptPassword(b []byte) ([]byte, error) {
}
func DecryptPassword(b []byte) (string, error) {
nonce := viper.Get("nonce").(string)
password := viper.Get("password").(string)
dev := viper.Get("device").(string)
nonce := viper.GetString("nonce")
password := viper.GetString("password")
dev := viper.GetString("device")
block, err := aes.NewCipher([]byte(dev))
if err != nil {