Memorizing data in Cortex M4 Keil 4 and Keil 5

I would like  to make devices to put passwords for example. I like owner to change, put new passwords, erase the password and stay in memory after disconnecting from electrical power.Where to put these passwords and how to program this? I am working in Keil 4 and Keil 5.Iam working in Cortex M4.Please tell me examples, literature.

I am reading the books The Definitive Guide to ARM® Cortex®-M3 and Cortex®-M4 Processors,Thirth edition. by Joseph Yiu


Embedded Software in C for an ARM Cortex M by Jonathan W. Valvano and Ramesh Yerraballi (1/2015)