package crud import ( "fmt" "os" "gitlab.com/whiteboardguy/eno/internal/crypt" "gitlab.com/whiteboardguy/eno/internal/utils" ) func NewNote(noteName, output string) error { fmt.Printf("Enter the super secure passphrase: ") password, err := utils.TakeSecureUserInput() if err != nil { return fmt.Errorf("failed to read passphrase: %v", err) } encrypted, err := crypt.EncryptRawBytes([]byte(noteName), password) if err != nil { return err } fmt.Println(output) file, err := os.Create(output) if err != nil { return err } _, err = file.Write(encrypted) if err != nil { return err } file.Sync() return nil }