'Storage of symmetric keys in Golang

I am currently developing an application which uses symmetric key encryption, with the key generated from an user provided password. I want to include a way for the user to log-in to the application, so for that I need to store the key somewhere accessible by different processes. I am currently using a temporary file for beta testing, but I know that is not very secure. What will be a simple key storage solution in golang?



Solution 1:[1]

Sensitive information, such as keys, should not be stored in your program/executable as this leaves them vulnerable. You can store the keys outside of your program using a database (where they should not be stored in plain-text) or by using a config file that can be read by your program. You can read more about it on this google forum.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Zoe