Skip to content

Securing_Password

moh-hassan edited this page Nov 6, 2023 · 1 revision

Password is encrypted during runtime

For security, the password is encrypted during runtime and is not stored as plain text.

o2pgen reads the password and token from either the command line or a file, encrypts them, and stores them in a SecureContainer class. Once the password and token are no longer needed, o2pgen clears them from memory and overwrites their contents with zeros to ensure that no trace of the password or token remains.

When a password is entered via the command line, o2pgen stores it as a SecureString and encrypts it. The password is decrypted at the point of use, but it is never stored as plain text. This ensures that the password remains secure even if the system is compromised.


Reading password from keyboard and Encrypted

To enter the password for o2pgen, use a single dash - or question mark ? as a placeholder. When prompted for the password, o2pgen will read characters from the console and mask them with asterisks for security.

example

use ? as placeHolder

-u user1 -p ?

OR use single dash - as PlaceHolder

-u user1 -p -

After displaying the message Enter password: on the screen, o2pgen waits for the user to enter the password using the keyboard, one character at a time. For security, the password is displayed on the screen as *****.

Once the password is entered, o2pgen stores the encrypted password in a secured container. When the password is needed, o2pgen decrypts it and then overwrites the contents of the password with zeros to ensure that it cannot be accessed from memory.

Clone this wiki locally