Insecure Cryptographic Storage & Security | Secure Code Warrior
Data is the lifeblood of businesses. It's the foundational information needed for survival, to make money, and to provide services to their customers. In this increasingly digital-focused society, developers have immense responsibility as the stewards of this precious information. When developers don't protect confidential data, the business falls prey to insecure cryptographic storage.
Let's take a look at how to securely store data, and what can happen when you don't.
Understand Insecure Cryptographic Storage
When attackers gain access to a system, they're typically on the hunt for data of value. You know - the type of data that can be used to take over someone's account, or used to execute another attack. Sometimes, this kind of data is simply sold on the black market for quick cash.
Insecure cryptographic storage is not a single vulnerability like SQL injection or XSS. It is a consequence of not protecting the data you should be protecting, in the way you need to protect it.
Sensitive information must be protected. When you store passwords and credit card information in plaintext, you are playing Russian roulette with your business.
If a hacker breaks into your database and steals data using SQL injection, XML injection or any other attack, they'll have everything. However, if you encrypt your data, they'll have a much tougher time making any real use of it.
It's important to note that breaches are not always the result of a malicious outsider. A rogue insider can also steal data with ease if it isn't encrypted. Employees at your company don't need to see everything in the database, and inadequate access controls or exposed sensitive data can lead to outright theft.
Remember, too, that all encryption is not equal. Using the wrong cryptographic algorithms is just as dangerous as not using them at all. Known weak algorithms will offer little resistance to savvy attackers.
Why Insecure Cryptographic Storage is Dangerous
Many companies are compromised by another vulnerability (such as SQL injection) and end up unable to hide the data that was stolen. This makes a terrible situation even worse.
- Adult Friend Finder was breached, leaking 412 million accounts. The passwords for the accounts were protected with the weak SHA-1 hashing algorithm. They were easily cracked by attackers within a month.
- Uber was breached, leaking 57 million user records and 600,000 driver records. Personal information was lost. It happened because Uber's GitHub account had a repository containing Uber's AWS account username and password out in the open... not a good idea. Uber's valuation dropped by $20 billion, largely due to this breach.
- Sony's PlayStation Network was breached, leaking 77 million accounts. 12 million of the accounts contained unencrypted credit card information. Sony later settled a $15 million class-action lawsuit for the breach.
There are clearly severe consequences for not storing sensitive data properly.
Sony was sued, which is a significant penalty. However, even if you aren't sued, the reputational and regulatory damage could be catastrophic for a business.
Defeat Insecure Cryptographic Storage
How can developers prevent data breaches like those above from happening?
The first step is to identify which data requires encryption in the first place. After all, not all data is equal. Categorize your data, then use encryption where appropriate.
In general, personal information like social security numbers, passwords and credit card details must be protected. Depending on the nature of your business, you may need to protect health records or other information that is considered private.
Once you know what data needs to be protected, the next step is using the right tools to ensure its security. In general, it's good to stick to cryptographic algorithms which have stood the test of time and are considered strong.
No matter what, do not write your own cryptographic functions. They're likely to contain flaws attackers can use to break encryption.
To encrypt data such as social security numbers or credit card data, use AES. There are different modes of operation for AES, a highly recommended mode at the time of writing is Galois/Counter Mode (GCM). Another tip is to ensure no padding is used for libraries that ask you to choose a type of padding.
For passwords, use a hash algorithm to hash passwords because hashes cannot be reversed. Given a strongly hashed value, an attacker can't retrieve the original text that created the value. Argon2and Bcryptare considered solid choices for hashing passwords. Remember to always "salt" the password with a random value before hashing so no two hashes are alike for the same password.
These functions will have implementations for all major programming languages/frameworks. Check out the documentation for your specific language or framework for information on how to use them effectively.
Key generation, storage, and management are important components of cryptography. Poorly managed keys can be exposed and used to decrypt your data. Some frameworks help with key management, such as ASP.NET's Data Protection API. For general best practices for key management, check out OWASP's cheat sheet.
Securely storing your data is how you prevent costly, embarrassing data breaches. In the worst-case scenario, if an attacker is able to steal your data, they will have a much more difficult time seeing or using it for any nefarious purpose.
Hide Your Data in Plain Sight
Let's quickly review how to protect your data:
- Categorize your data so you know what requires protection
- Use strong, industry-vetted algorithms for encrypting sensitive data
- Store your passwords using strong one-way hashes
To further study the subject, check out our Learning Resources. When you're ready to dig in and practice, try out our platform in your preferred language. We cover a lot!
With these tools, you can prevent your data from being stolen and prevent your company from losing money and damaging its reputation.
Ready to find and fix insecure cryptographic storage right now? Head to the arena and test your skills [start here]


In this digital society, developers are responsible for keeping info & businesses safe from insecure cryptographic storage. Learn from Secure Code Warrior.
Jaap Karan Singh is a Secure Coding Evangelist, Chief Singh and co-founder of Secure Code Warrior.

Secure Code Warrior is here for your organization to help you secure code across the entire software development lifecycle and create a culture in which cybersecurity is top of mind. Whether you’re an AppSec Manager, Developer, CISO, or anyone involved in security, we can help your organization reduce risks associated with insecure code.
Book a demoJaap Karan Singh is a Secure Coding Evangelist, Chief Singh and co-founder of Secure Code Warrior.


Data is the lifeblood of businesses. It's the foundational information needed for survival, to make money, and to provide services to their customers. In this increasingly digital-focused society, developers have immense responsibility as the stewards of this precious information. When developers don't protect confidential data, the business falls prey to insecure cryptographic storage.
Let's take a look at how to securely store data, and what can happen when you don't.
Understand Insecure Cryptographic Storage
When attackers gain access to a system, they're typically on the hunt for data of value. You know - the type of data that can be used to take over someone's account, or used to execute another attack. Sometimes, this kind of data is simply sold on the black market for quick cash.
Insecure cryptographic storage is not a single vulnerability like SQL injection or XSS. It is a consequence of not protecting the data you should be protecting, in the way you need to protect it.
Sensitive information must be protected. When you store passwords and credit card information in plaintext, you are playing Russian roulette with your business.
If a hacker breaks into your database and steals data using SQL injection, XML injection or any other attack, they'll have everything. However, if you encrypt your data, they'll have a much tougher time making any real use of it.
It's important to note that breaches are not always the result of a malicious outsider. A rogue insider can also steal data with ease if it isn't encrypted. Employees at your company don't need to see everything in the database, and inadequate access controls or exposed sensitive data can lead to outright theft.
Remember, too, that all encryption is not equal. Using the wrong cryptographic algorithms is just as dangerous as not using them at all. Known weak algorithms will offer little resistance to savvy attackers.
Why Insecure Cryptographic Storage is Dangerous
Many companies are compromised by another vulnerability (such as SQL injection) and end up unable to hide the data that was stolen. This makes a terrible situation even worse.
- Adult Friend Finder was breached, leaking 412 million accounts. The passwords for the accounts were protected with the weak SHA-1 hashing algorithm. They were easily cracked by attackers within a month.
- Uber was breached, leaking 57 million user records and 600,000 driver records. Personal information was lost. It happened because Uber's GitHub account had a repository containing Uber's AWS account username and password out in the open... not a good idea. Uber's valuation dropped by $20 billion, largely due to this breach.
- Sony's PlayStation Network was breached, leaking 77 million accounts. 12 million of the accounts contained unencrypted credit card information. Sony later settled a $15 million class-action lawsuit for the breach.
There are clearly severe consequences for not storing sensitive data properly.
Sony was sued, which is a significant penalty. However, even if you aren't sued, the reputational and regulatory damage could be catastrophic for a business.
Defeat Insecure Cryptographic Storage
How can developers prevent data breaches like those above from happening?
The first step is to identify which data requires encryption in the first place. After all, not all data is equal. Categorize your data, then use encryption where appropriate.
In general, personal information like social security numbers, passwords and credit card details must be protected. Depending on the nature of your business, you may need to protect health records or other information that is considered private.
Once you know what data needs to be protected, the next step is using the right tools to ensure its security. In general, it's good to stick to cryptographic algorithms which have stood the test of time and are considered strong.
No matter what, do not write your own cryptographic functions. They're likely to contain flaws attackers can use to break encryption.
To encrypt data such as social security numbers or credit card data, use AES. There are different modes of operation for AES, a highly recommended mode at the time of writing is Galois/Counter Mode (GCM). Another tip is to ensure no padding is used for libraries that ask you to choose a type of padding.
For passwords, use a hash algorithm to hash passwords because hashes cannot be reversed. Given a strongly hashed value, an attacker can't retrieve the original text that created the value. Argon2and Bcryptare considered solid choices for hashing passwords. Remember to always "salt" the password with a random value before hashing so no two hashes are alike for the same password.
These functions will have implementations for all major programming languages/frameworks. Check out the documentation for your specific language or framework for information on how to use them effectively.
Key generation, storage, and management are important components of cryptography. Poorly managed keys can be exposed and used to decrypt your data. Some frameworks help with key management, such as ASP.NET's Data Protection API. For general best practices for key management, check out OWASP's cheat sheet.
Securely storing your data is how you prevent costly, embarrassing data breaches. In the worst-case scenario, if an attacker is able to steal your data, they will have a much more difficult time seeing or using it for any nefarious purpose.
Hide Your Data in Plain Sight
Let's quickly review how to protect your data:
- Categorize your data so you know what requires protection
- Use strong, industry-vetted algorithms for encrypting sensitive data
- Store your passwords using strong one-way hashes
To further study the subject, check out our Learning Resources. When you're ready to dig in and practice, try out our platform in your preferred language. We cover a lot!
With these tools, you can prevent your data from being stolen and prevent your company from losing money and damaging its reputation.
Ready to find and fix insecure cryptographic storage right now? Head to the arena and test your skills [start here]

Data is the lifeblood of businesses. It's the foundational information needed for survival, to make money, and to provide services to their customers. In this increasingly digital-focused society, developers have immense responsibility as the stewards of this precious information. When developers don't protect confidential data, the business falls prey to insecure cryptographic storage.
Let's take a look at how to securely store data, and what can happen when you don't.
Understand Insecure Cryptographic Storage
When attackers gain access to a system, they're typically on the hunt for data of value. You know - the type of data that can be used to take over someone's account, or used to execute another attack. Sometimes, this kind of data is simply sold on the black market for quick cash.
Insecure cryptographic storage is not a single vulnerability like SQL injection or XSS. It is a consequence of not protecting the data you should be protecting, in the way you need to protect it.
Sensitive information must be protected. When you store passwords and credit card information in plaintext, you are playing Russian roulette with your business.
If a hacker breaks into your database and steals data using SQL injection, XML injection or any other attack, they'll have everything. However, if you encrypt your data, they'll have a much tougher time making any real use of it.
It's important to note that breaches are not always the result of a malicious outsider. A rogue insider can also steal data with ease if it isn't encrypted. Employees at your company don't need to see everything in the database, and inadequate access controls or exposed sensitive data can lead to outright theft.
Remember, too, that all encryption is not equal. Using the wrong cryptographic algorithms is just as dangerous as not using them at all. Known weak algorithms will offer little resistance to savvy attackers.
Why Insecure Cryptographic Storage is Dangerous
Many companies are compromised by another vulnerability (such as SQL injection) and end up unable to hide the data that was stolen. This makes a terrible situation even worse.
- Adult Friend Finder was breached, leaking 412 million accounts. The passwords for the accounts were protected with the weak SHA-1 hashing algorithm. They were easily cracked by attackers within a month.
- Uber was breached, leaking 57 million user records and 600,000 driver records. Personal information was lost. It happened because Uber's GitHub account had a repository containing Uber's AWS account username and password out in the open... not a good idea. Uber's valuation dropped by $20 billion, largely due to this breach.
- Sony's PlayStation Network was breached, leaking 77 million accounts. 12 million of the accounts contained unencrypted credit card information. Sony later settled a $15 million class-action lawsuit for the breach.
There are clearly severe consequences for not storing sensitive data properly.
Sony was sued, which is a significant penalty. However, even if you aren't sued, the reputational and regulatory damage could be catastrophic for a business.
Defeat Insecure Cryptographic Storage
How can developers prevent data breaches like those above from happening?
The first step is to identify which data requires encryption in the first place. After all, not all data is equal. Categorize your data, then use encryption where appropriate.
In general, personal information like social security numbers, passwords and credit card details must be protected. Depending on the nature of your business, you may need to protect health records or other information that is considered private.
Once you know what data needs to be protected, the next step is using the right tools to ensure its security. In general, it's good to stick to cryptographic algorithms which have stood the test of time and are considered strong.
No matter what, do not write your own cryptographic functions. They're likely to contain flaws attackers can use to break encryption.
To encrypt data such as social security numbers or credit card data, use AES. There are different modes of operation for AES, a highly recommended mode at the time of writing is Galois/Counter Mode (GCM). Another tip is to ensure no padding is used for libraries that ask you to choose a type of padding.
For passwords, use a hash algorithm to hash passwords because hashes cannot be reversed. Given a strongly hashed value, an attacker can't retrieve the original text that created the value. Argon2and Bcryptare considered solid choices for hashing passwords. Remember to always "salt" the password with a random value before hashing so no two hashes are alike for the same password.
These functions will have implementations for all major programming languages/frameworks. Check out the documentation for your specific language or framework for information on how to use them effectively.
Key generation, storage, and management are important components of cryptography. Poorly managed keys can be exposed and used to decrypt your data. Some frameworks help with key management, such as ASP.NET's Data Protection API. For general best practices for key management, check out OWASP's cheat sheet.
Securely storing your data is how you prevent costly, embarrassing data breaches. In the worst-case scenario, if an attacker is able to steal your data, they will have a much more difficult time seeing or using it for any nefarious purpose.
Hide Your Data in Plain Sight
Let's quickly review how to protect your data:
- Categorize your data so you know what requires protection
- Use strong, industry-vetted algorithms for encrypting sensitive data
- Store your passwords using strong one-way hashes
To further study the subject, check out our Learning Resources. When you're ready to dig in and practice, try out our platform in your preferred language. We cover a lot!
With these tools, you can prevent your data from being stolen and prevent your company from losing money and damaging its reputation.
Ready to find and fix insecure cryptographic storage right now? Head to the arena and test your skills [start here]

Click on the link below and download the PDF of this resource.
Secure Code Warrior is here for your organization to help you secure code across the entire software development lifecycle and create a culture in which cybersecurity is top of mind. Whether you’re an AppSec Manager, Developer, CISO, or anyone involved in security, we can help your organization reduce risks associated with insecure code.
View reportBook a demoJaap Karan Singh is a Secure Coding Evangelist, Chief Singh and co-founder of Secure Code Warrior.
Data is the lifeblood of businesses. It's the foundational information needed for survival, to make money, and to provide services to their customers. In this increasingly digital-focused society, developers have immense responsibility as the stewards of this precious information. When developers don't protect confidential data, the business falls prey to insecure cryptographic storage.
Let's take a look at how to securely store data, and what can happen when you don't.
Understand Insecure Cryptographic Storage
When attackers gain access to a system, they're typically on the hunt for data of value. You know - the type of data that can be used to take over someone's account, or used to execute another attack. Sometimes, this kind of data is simply sold on the black market for quick cash.
Insecure cryptographic storage is not a single vulnerability like SQL injection or XSS. It is a consequence of not protecting the data you should be protecting, in the way you need to protect it.
Sensitive information must be protected. When you store passwords and credit card information in plaintext, you are playing Russian roulette with your business.
If a hacker breaks into your database and steals data using SQL injection, XML injection or any other attack, they'll have everything. However, if you encrypt your data, they'll have a much tougher time making any real use of it.
It's important to note that breaches are not always the result of a malicious outsider. A rogue insider can also steal data with ease if it isn't encrypted. Employees at your company don't need to see everything in the database, and inadequate access controls or exposed sensitive data can lead to outright theft.
Remember, too, that all encryption is not equal. Using the wrong cryptographic algorithms is just as dangerous as not using them at all. Known weak algorithms will offer little resistance to savvy attackers.
Why Insecure Cryptographic Storage is Dangerous
Many companies are compromised by another vulnerability (such as SQL injection) and end up unable to hide the data that was stolen. This makes a terrible situation even worse.
- Adult Friend Finder was breached, leaking 412 million accounts. The passwords for the accounts were protected with the weak SHA-1 hashing algorithm. They were easily cracked by attackers within a month.
- Uber was breached, leaking 57 million user records and 600,000 driver records. Personal information was lost. It happened because Uber's GitHub account had a repository containing Uber's AWS account username and password out in the open... not a good idea. Uber's valuation dropped by $20 billion, largely due to this breach.
- Sony's PlayStation Network was breached, leaking 77 million accounts. 12 million of the accounts contained unencrypted credit card information. Sony later settled a $15 million class-action lawsuit for the breach.
There are clearly severe consequences for not storing sensitive data properly.
Sony was sued, which is a significant penalty. However, even if you aren't sued, the reputational and regulatory damage could be catastrophic for a business.
Defeat Insecure Cryptographic Storage
How can developers prevent data breaches like those above from happening?
The first step is to identify which data requires encryption in the first place. After all, not all data is equal. Categorize your data, then use encryption where appropriate.
In general, personal information like social security numbers, passwords and credit card details must be protected. Depending on the nature of your business, you may need to protect health records or other information that is considered private.
Once you know what data needs to be protected, the next step is using the right tools to ensure its security. In general, it's good to stick to cryptographic algorithms which have stood the test of time and are considered strong.
No matter what, do not write your own cryptographic functions. They're likely to contain flaws attackers can use to break encryption.
To encrypt data such as social security numbers or credit card data, use AES. There are different modes of operation for AES, a highly recommended mode at the time of writing is Galois/Counter Mode (GCM). Another tip is to ensure no padding is used for libraries that ask you to choose a type of padding.
For passwords, use a hash algorithm to hash passwords because hashes cannot be reversed. Given a strongly hashed value, an attacker can't retrieve the original text that created the value. Argon2and Bcryptare considered solid choices for hashing passwords. Remember to always "salt" the password with a random value before hashing so no two hashes are alike for the same password.
These functions will have implementations for all major programming languages/frameworks. Check out the documentation for your specific language or framework for information on how to use them effectively.
Key generation, storage, and management are important components of cryptography. Poorly managed keys can be exposed and used to decrypt your data. Some frameworks help with key management, such as ASP.NET's Data Protection API. For general best practices for key management, check out OWASP's cheat sheet.
Securely storing your data is how you prevent costly, embarrassing data breaches. In the worst-case scenario, if an attacker is able to steal your data, they will have a much more difficult time seeing or using it for any nefarious purpose.
Hide Your Data in Plain Sight
Let's quickly review how to protect your data:
- Categorize your data so you know what requires protection
- Use strong, industry-vetted algorithms for encrypting sensitive data
- Store your passwords using strong one-way hashes
To further study the subject, check out our Learning Resources. When you're ready to dig in and practice, try out our platform in your preferred language. We cover a lot!
With these tools, you can prevent your data from being stolen and prevent your company from losing money and damaging its reputation.
Ready to find and fix insecure cryptographic storage right now? Head to the arena and test your skills [start here]
Table of contents
Jaap Karan Singh is a Secure Coding Evangelist, Chief Singh and co-founder of Secure Code Warrior.

Secure Code Warrior is here for your organization to help you secure code across the entire software development lifecycle and create a culture in which cybersecurity is top of mind. Whether you’re an AppSec Manager, Developer, CISO, or anyone involved in security, we can help your organization reduce risks associated with insecure code.
Book a demoDownloadResources to get you started
Benchmarking Security Skills: Streamlining Secure-by-Design in the Enterprise
Finding meaningful data on the success of Secure-by-Design initiatives is notoriously difficult. CISOs are often challenged when attempting to prove the return on investment (ROI) and business value of security program activities at both the people and company levels. Not to mention, it’s particularly difficult for enterprises to gain insights into how their organizations are benchmarked against current industry standards. The President’s National Cybersecurity Strategy challenged stakeholders to “embrace security and resilience by design.” The key to making Secure-by-Design initiatives work is not only giving developers the skills to ensure secure code, but also assuring the regulators that those skills are in place. In this presentation, we share a myriad of qualitative and quantitative data, derived from multiple primary sources, including internal data points collected from over 250,000 developers, data-driven customer insights, and public studies. Leveraging this aggregation of data points, we aim to communicate a vision of the current state of Secure-by-Design initiatives across multiple verticals. The report details why this space is currently underutilized, the significant impact a successful upskilling program can have on cybersecurity risk mitigation, and the potential to eliminate categories of vulnerabilities from a codebase.
Secure code training topics & content
Our industry-leading content is always evolving to fit the ever changing software development landscape with your role in mind. Topics covering everything from AI to XQuery Injection, offered for a variety of roles from Architects and Engineers to Product Managers and QA. Get a sneak peak of what our content catalog has to offer by topic and role.
Quests: Industry leading learning to keep developers ahead of the game mitigating risk.
Quests is a learning platform that helps developers mitigate software security risks by enhancing their secure coding skills. With curated learning paths, hands-on challenges, and interactive activities, it empowers developers to identify and prevent vulnerabilities.
Resources to get you started
Is Vibe Coding Going to Turn Your Codebase Into a Frat Party?
Vibe coding is like a college frat party, and AI is the centerpiece of all the festivities, the keg. It’s a lot of fun to let loose, get creative, and see where your imagination can take you, but after a few keg stands, drinking (or, using AI) in moderation is undoubtedly the safer long-term solution.
The Decade of the Defenders: Secure Code Warrior Turns Ten
Secure Code Warrior's founding team has stayed together, steering the ship through every lesson, triumph, and setback for an entire decade. We’re scaling up and ready to face our next chapter, SCW 2.0, as the leaders in developer risk management.