DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • What’s the Future of Device Management? 5 Predictions For What Lies Ahead
  • Process Mining Key Elements
  • SIEM Volume Spike Alerts Using ML
  • API Analytics: Unleashing the Power of Data-Driven Insights for Enhanced API Management

Trending

  • How to Submit a Post to DZone
  • Tired of Spring Overhead? Try Dropwizard for Your Next Java Microservice
  • The Smart Way to Talk to Your Database: Why Hybrid API + NL2SQL Wins
  • Enforcing Architecture With ArchUnit in Java
  1. DZone
  2. Software Design and Architecture
  3. Security
  4. What Is Encryption and How Does It Work?

What Is Encryption and How Does It Work?

Encryption encodes data, so only programs that know how to decode it can read it. Most encryption programs use a "key" to transform plaintext into ciphertext.

By 
Eric Goebelbecker user avatar
Eric Goebelbecker
DZone Core CORE ·
Aug. 29, 22 · Analysis
Likes (2)
Comment
Save
Tweet
Share
10.2K Views

Join the DZone community and get the full member experience.

Join For Free

What Is Encryption?

Encryption encodes data, so only programs that know how to decode it can read it. It uses an algorithm—a set of ordered steps—to alter the information so that the receiving party can't read it without applying a similar algorithm to return it to its original state.

Encoding data is called encrypting. Decoding is called decrypting. The original unencrypted data is called plaintext, while we refer to the encrypted data as ciphertext. So, we encrypt plaintext into ciphertext and decrypt the ciphertext back into plaintext.

Figuring out how to decode data without the algorithm is called "breaking the encryption."

We use encryption to protect information so only the people and programs that need to see it can. We do this for many reasons, such as protecting financial information or simply safeguarding our privacy.

If you use a password manager, it stores your passwords in an encrypted file. Many computers go a step beyond encrypting files and use fully encrypted disks that you can't read without a password that unlocks the encryption. So, if someone steals the computer, they can't simply remove the disk and read it with another system.

You use encryption every day as you browse the web since nearly every website has moved to encrypted connections via Transport Layer Security (TLS)

How Does Encryption Work?

Most encryption programs use a "key" to transform plaintext into ciphertext, while the corresponding decryption program uses a key to decrypt it. As we'll see below, the most robust systems don't use the same keys to encrypt and decrypt data.

Given enough time and resources, you can break encryption via a "brute-force" attack.  This will always be possible, but the goal of encryption algorithms is to make the process take too long or require too many resources.

So, modern encryption has continually strengthened as computers become more powerful and more able to break encryption algorithms that were previously considered safe. Brute forcing your way through a scheme considered in the past might be easy today.

Encryption keys are usually created with a random or, more accurately, pseudo-random numbers and are generated by another algorithm.

Public and Private Keys

The most common encryption schemes use key pairs. Each pair comprises a private key, which only the owner should possess, and a public key that the owner shares with trusted parties. These keys rely on one-way functions to keep data safe. So, one key can encrypt data, and only the other can decrypt it.

When someone wants to send data to a key owner, they use the public key to encrypt it and send the ciphertext. Because of the nature of the keys and the algorithms, and only the private key can decrypt the text. So, the key pair owner can receive data from more than one person, and only they can read the messages, while the people sending the data can't read each other's mail.

You can also use the private key to "sign" a message with a digital signature that the receiver can verify with your public key. This helps authenticate the message by ensuring that you sent it.

Public Key Certificates

Public key certificates often called digital certificates or "certs," are files that prove the validity of public keys. They perform the authentication part of data encryption by verifying the sender of encrypted data.

A cert contains information about the key, the owner, and a digital signature from an entity that verifies the cert's contents. This entity is a critical part of the trust chain. If you trust them, you know you can trust the certificate and the key. 

For example, in TLS, a certificate's subject is typically a computer or other device, and it's the signing authority that verifies that the computer you're talking to is who they say they are. This helps prevent man-in-the-middle attacks.

Encryption Doesn't Have to Be Complicated

The underlying algorithms in data encryption involve a lot of complicated math, but once you understand them, the mechanics are rather simple. If you understand how keys work, you can understand how to secure data is transferred.

Computer IT Password manager TLS Algorithm Data (computing) Scheme (programming language) security SENT (protocol) Trust (business)

Opinions expressed by DZone contributors are their own.

Related

  • What’s the Future of Device Management? 5 Predictions For What Lies Ahead
  • Process Mining Key Elements
  • SIEM Volume Spike Alerts Using ML
  • API Analytics: Unleashing the Power of Data-Driven Insights for Enhanced API Management

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!