A password is a way of authentication. It can be used as a means to identify a person. Since the password is the only way to identify a person, it has to be kept secret. A password can be static. This means it will remain the same unless the user changes it, or it rarely changes. Or a password can be dynamic. A dynamic password changes regularly and does not remain the same. One type of a dynamic password is a one-time pad that can only be used once.
Passwords were first used in the military. This was to be able to tell who was a friend and who was an enemy when it was dark.
Modern passwords are made of characters, letters and numbers. Sometimes a password will require a minimum number of characters. Usually this is from six to eight. Some websites allow only the use of letters and numbers, but no other characters on the keyboard. Other websites advise using a combination of letters and numbers to increase the "strength" of a password. Websites also advise changing a password once a year or more often to prevent hacking. A person may be able to guess a password if it is too easy. While being typed, each letter of a password is shown as * or.
Other ways of verifying the identity of a person include using fingerprint scanners and face detection.
Encryption is the translation of data to achieve data security. To read an encrypted string a secret key or password must be provided to decrypt it.
In systems that uses login based actions, the password can be converted to the original string if the key is provided. Hashing is a one-way function and is irreversible.