Encryption turns readable data into ciphertext using an algorithm and a key. Decryption uses the matching key material to recover the original data.

The algorithm does not need to be secret. The key does. A well-known, reviewed algorithm with protected keys is safer than a homemade cipher whose only defense is hidden code.

A small example

Suppose a phone stores a private note. The app encrypts the note before writing it to storage. Someone who copies only the encrypted file should not be able to read the note without the required key.

When the owner unlocks the app, it obtains or derives the key and decrypts the note. If malware controls the unlocked phone, encryption at rest may not help because the app can already access the readable data. The threat and timing matter.

Symmetric and asymmetric encryption

Symmetric encryption uses the same secret key, or closely related secret material, for encryption and decryption. It is fast and commonly protects files, disks and network data after a secure session is established.

Asymmetric cryptography uses a public and private key pair. The public key can be shared. The private key must remain controlled. Public-key systems can help establish shared secrets, encrypt small pieces of data in suitable schemes and create digital signatures.

Real systems often combine both. A public-key method establishes or protects a session key, then a symmetric algorithm handles the data. NIST's key-encapsulation guidance describes how two parties can establish shared secret key material for secure communication.

Encryption should also detect changes

Confidentiality alone hides content. It does not always prove that the ciphertext was not changed. Modern applications usually need authenticated encryption, which protects confidentiality and checks integrity and authenticity for the encrypted message.

Do not design a new combination of cipher, mode, padding and message authentication code without specialist review. Use maintained libraries and high-level APIs that provide an approved authenticated mode for the platform.

The key is part of the security boundary

A strong algorithm cannot protect data when the key is stored beside it in plain text, logged to analytics or shared in a public code repository. Key generation, storage, access, rotation, backup and destruction all matter.

NIST publishes key-management guidance covering the protection and life cycle of cryptographic keying material. Organizations should follow the rules that apply to their systems and data, not copy an example key from a tutorial.

Passwords are not ready-made encryption keys

Human passwords are often short and predictable. A password-based encryption system normally uses a password-based key derivation function with a unique salt and a work factor. This makes each guess more expensive and prevents identical passwords from producing identical derived keys in the same simple way.

The salt is not a secret. The password is. The work factor must be chosen for the current platform and revisited over time. Use the password-encryption feature provided by a maintained product instead of inventing a derivation formula.

Hashing and encoding are not encryption

OperationPurposeReversible?
EncryptionProtect readable data with a key.Yes, with the correct key and method.
HashingCreate a fixed-length digest for integrity or other defined uses.Not designed to be reversed.
EncodingRepresent data in another form for transport or storage.Yes, without a secret key.
CompressionReduce data size.Yes, without secrecy.

Base64 is encoding. Anyone can decode it. A checksum can detect accidental changes but is not automatically a secure message authentication method.

Encryption at rest and in transit

At rest refers to stored data, such as a phone, database backup or laptop disk. In transit refers to data moving between systems, often protected by protocols such as TLS.

One does not replace the other. A website can use HTTPS while storing exported backups without encryption. A laptop can use full-disk encryption while an email attachment travels through an unapproved channel. Map where readable copies exist.

Also check logs, temporary files and crash reports. An application may encrypt its main database while writing sensitive plaintext into those supporting files.

What encryption does not fix

  • An attacker using an account that is already signed in.
  • Malware reading data after the app decrypts it.
  • A weak recovery process that gives keys to the wrong person.
  • Screenshots, printouts and copied plaintext.
  • Metadata that the chosen system leaves visible.
  • Lost keys when no approved recovery copy exists.
  • A vulnerable application exposing decrypted data.

Before using an encryption tool

  1. Identify the data and the person or event you are protecting it from.
  2. Check which algorithm and authenticated mode the product uses.
  3. Confirm how keys or passwords are generated and stored.
  4. Find out whether data is processed locally or uploaded.
  5. Test recovery with a noncritical file.
  6. Keep an approved backup of the key when loss would be unacceptable.
  7. Document who can decrypt the data.
  8. Plan what happens when access changes or a key is exposed.

NIST keeps current standards and guidance under its Cryptographic Standards and Guidelines project. Product teams should use applicable current standards and maintained implementations.

Encryption questions

Can encrypted data be hacked?

No security control removes every risk. Attackers may target weak passwords, stolen keys, software bugs, unlocked devices or recovery systems instead of the cipher.

Can I decrypt a file without its key?

A correctly implemented system is designed to prevent that. Look for an authorized recovery key or backup rather than bypass claims.

Is AES the same as a complete encryption system?

No. AES is a block cipher. Safe use also needs a suitable mode, nonce handling, authentication, key management and correct implementation.

Is Base64 encrypted?

No. It is an encoding that can be reversed without a secret.

Does HTTPS protect a downloaded file forever?

HTTPS protects the network connection. Protection after download depends on the device, app, permissions and storage.

Should I write my own encryption code?

Use a maintained, reviewed library or platform feature. Cryptographic design and implementation errors are easy to miss.