11.07.2015 Views

Improving Web Application Security: Threats and - CGISecurity

Improving Web Application Security: Threats and - CGISecurity

Improving Web Application Security: Threats and - CGISecurity

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 5: Architecture <strong>and</strong> Design Review for <strong>Security</strong> 119CryptographyIf your application uses cryptography to provide security, examine what it is used for<strong>and</strong> the way it is used. Table 5.7 shows the most common vulnerabilities relating tocryptography.Table 5.7 Common Cryptography VulnerabilitiesVulnerabilityImplicationsUsing custom cryptographyThis is almost certainly less secure than the tried <strong>and</strong>tested platform-provided cryptography.Using the wrong algorithm or toosmall a key sizeFailing to secure encryption keysUsing the same key for a prolongedperiod of timeNewer algorithms increase security. Larger key sizesincrease security.Encrypted data is only as secure as the encryption key.A static key is more likely to be discovered over time.Review the following questions to help validate the h<strong>and</strong>ling of sensitive data byyour application:● Why do you use particular algorithms?● How do you secure encryption keys?Why Do You Use Particular Algorithms?Cryptography only provides real security if it is used appropriately <strong>and</strong> the rightalgorithms are used for the right job. The strength of the algorithm is also important.Review the following questions to review your use of cryptographic algorithms:●●Do you develop your own cryptography?Do not. Cryptographic algorithms <strong>and</strong> routines are notoriously difficult to develop<strong>and</strong> get right. Custom implementations frequently result in weak protection <strong>and</strong>are almost always less secure than the proven platform-provided services.Do you use the right algorithm with an adequate key size?Examine what algorithms your application uses <strong>and</strong> for what purpose. Larger keysizes result in improved security, but performance suffers. Stronger encryption ismost important for persisted data that is retained in data stores for prolongedperiods of time.For more information about choosing an appropriate algorithm <strong>and</strong> key size, see theCryptography section in Chapter 4, “Design Guidelines for Secure <strong>Web</strong><strong>Application</strong>s.”

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!