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
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
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
Partner Zones AWS Cloud
by AWS Developer Relations
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
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report

How to Screw Up Encryption

Let's see where encryption protocols go wrong.

Christopher Lamb user avatar by
Christopher Lamb
CORE ·
Mar. 25, 19 · Opinion
Like (2)
Save
Tweet
Share
5.21K Views

Join the DZone community and get the full member experience.

Join For Free

Today, we mess up encryption application in two primary ways. We either try to create our own (always a bad idea) or misconfigure protocols to use weak algorithms (also a bad idea, but it's surprisingly easy to do).

With respect to the first way we screw up encryption, we need to be a bit more detailed with respect to what we mean. When I say "create our own", I don't mean "try to create our own encryption algorithm". I mean, nobody's going to do this. Not that nobody can, after all the initials in RSA stand for real folks, but that it's likely that you don't know anybody who can do this. And that you don't know anybody who knows anybody who can do this. And for the most part we all realize this, so we don't try. Go us!

What I mean is "create our own encryption protocols". This kind of thing comes up more frequently than you'd think. When we're doing this kind of thing, we're using established encryption algorithms in some kind of a sequence to protect information. Examples include things like network communication, protecting data at rest over time, that kind of thing. And usually, you need to provide not only confidentiality, but integrity and some kind of authentication too. To do this, you'll use established protocols, things like AES and SHA and ECC. These are all strong algorithms (by which I mean provably strong), but by making small mistakes here and there, you can make them much, much weaker. Things like not using truly random initialization vectors, or not salting, or reusing keys. Or providing automatic fallbacks to known compromised algorithms. Or mis-designing your protocol so that attackers can circumvent encryption entirely via out-of-sequence messages.

Those last two popped up in OpenSSL and LibSSL, respectively, so even folks with lots of experience in these areas screw it up. If they do, imagine the kind of damage folks that don't work with crypto all day can do.

The second way we mess up encryption is misconfiguration. Really, this is pretty closely related to the kinds of mistakes you can make designing your own protocol. Usually, when you design your own protocol you don't put as many options in as other established protocols do, so you hard-code your mistakes. When configuring established protocols, you can make the same kinds of mistakes. Specific things to look out for are allowing the implementation to fall back to old, insecure protocols (like SSL3.0) and reusing keying material.

Trust me, whenever you're implementing encryption between systems, always try to use established systems with significant community or commercial support. Can you use an established system from a vendor or open source project? Do it. And the more documentation the better. Projects like OpenSSL or the Noise Framework are excellent options, and between those two you will probably take care of all your crypto needs. And make sure you know where you can get help and configuration information before you start. You don't want to be panicking over some small detail when you're hours from an implementation deadline. And make sure you give yourself enough time! Don't rush. This stuff is complicated.

If you avoid these mistakes and take my advice, you shouldn't have any problems implementing crypto systems the next time around. Good luck in advance!

Protocol (object-oriented programming)

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Test Execution Tutorial: A Comprehensive Guide With Examples and Best Practices
  • Use AWS Controllers for Kubernetes To Deploy a Serverless Data Processing Solution With SQS, Lambda, and DynamoDB
  • Kubernetes-Native Development With Quarkus and Eclipse JKube
  • Introduction To OpenSSH

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

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

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: