8) Insecure Cryptographic Storage Emmanuel Benoist Fall Term - - PowerPoint PPT Presentation

8 insecure cryptographic storage
SMART_READER_LITE
LIVE PREVIEW

8) Insecure Cryptographic Storage Emmanuel Benoist Fall Term - - PowerPoint PPT Presentation

8) Insecure Cryptographic Storage Emmanuel Benoist Fall Term 2020/2021 Berner Fachhochschule | Haute ecole sp ecialis ee bernoise | Berne University of Applied Sciences 1 Table of Contents Presentation Examples Attacks


slide-1
SLIDE 1

8) Insecure Cryptographic Storage

Emmanuel Benoist

Fall Term 2020/2021

Berner Fachhochschule | Haute ´ ecole sp´ ecialis´ ee bernoise | Berne University of Applied Sciences 1

slide-2
SLIDE 2

Table of Contents

  • Presentation
  • Examples

Attacks

  • Recommendations
  • PCI Data Security Standard
  • Conclusion

Berner Fachhochschule | Haute ´ ecole sp´ ecialis´ ee bernoise | Berne University of Applied Sciences 2

slide-3
SLIDE 3

Presentation

Berner Fachhochschule | Haute ´ ecole sp´ ecialis´ ee bernoise | Berne University of Applied Sciences 3

slide-4
SLIDE 4

Insecure Cryptographic Storage

Data and Credentials are rarely protected with cryptographic functions

Data collected can be used by attackers For Identity Theft

  • r other crimes like Credit Card Fraud

Most common problems

Not encrypting sensitive data Using home grown algorithms Insecure use of strong algorithms Continued use of proven weak algorithms (MD5, SHA-1, RC3, RC4, etc.) Hard coding keys, and storing keys in unprotected stores

Berner Fachhochschule | Haute ´ ecole sp´ ecialis´ ee bernoise | Berne University of Applied Sciences 4

slide-5
SLIDE 5

Examples

Berner Fachhochschule | Haute ´ ecole sp´ ecialis´ ee bernoise | Berne University of Applied Sciences 5

slide-6
SLIDE 6

Attacks

Berner Fachhochschule | Haute ´ ecole sp´ ecialis´ ee bernoise | Berne University of Applied Sciences 6

slide-7
SLIDE 7

E-Commerce Web Site

Suppose we manage a e-shop

We sell goods and clients pay using their credit cards We have to store the address and references of all our clients for the legal issues. Data stored: name, address, e-mail, phone, Credit Cards Numbers

Our web site is attacked

Attackers access to our Database They can harvest the whole content of our customer clients

Berner Fachhochschule | Haute ´ ecole sp´ ecialis´ ee bernoise | Berne University of Applied Sciences 7

slide-8
SLIDE 8

E-Commerce Web Site (Cont.)

Damages? For the Clients

Use of Credit Cards Number by attackers Privacy violation Identity Theft . . .

For The Web Site

Reputation Clients data stolen (can be resold to a competitor) Business secrets stolen

For the Credit Card Company

Reputation

Berner Fachhochschule | Haute ´ ecole sp´ ecialis´ ee bernoise | Berne University of Applied Sciences 8

slide-9
SLIDE 9

Which assets should be protected?

Passwords of users

Clear-text : accessible by SQL injection, or insiders Hashed : can be verified, but not read Problem : Easy to check using lists of hashed passwords (dictionary attack) Hashed with the same salt : Attackers need to find the salt Hashed using a generic salt and a specific salt

Credit Card Numbers

Ruled by the Credit card industry (see later)

Private keys

Should always been stored encrypted At least protected using a passphrase

Business dependant

Private data Social Security Number (AHV / AVS in Switzerland)

Berner Fachhochschule | Haute ´ ecole sp´ ecialis´ ee bernoise | Berne University of Applied Sciences 9

slide-10
SLIDE 10

Cryptographic tools

Encryption

If you need to read and write data: symmetric encryption (e.g. DES, AES) If reading and writing are done by different entities: asymmetric encryption (e.g. RSA)

One-way hash functions

One input has always the same output Impossible to go from the output back to the input No collision can be generated (two inputs having the same

  • utput)

Example : SHA-256

Berner Fachhochschule | Haute ´ ecole sp´ ecialis´ ee bernoise | Berne University of Applied Sciences 10

slide-11
SLIDE 11

Example: Self Made Crypto Algorithm

Hash Function We want to hash a Medical Record Number

Highly Sensitive data Require One-Way hashing Needs to be implemented by a partner.

Partner delivers a self-made algorithm

Based on Modulo This function is so complicated that it can not be reversed.

Berner Fachhochschule | Haute ´ ecole sp´ ecialis´ ee bernoise | Berne University of Applied Sciences 11

slide-12
SLIDE 12

Self Made Crypto Algorithm

Algorithm

Transform all the chars in the string into numbers Take an arbitrary number (always the same) Add this number to the last char, and modulo to remains in interval where conversion of number and char is automatic Add the obtained number to the penultimate char and modulo etc. The numbers obtained form a string The string is “secure”

Attack

Take the obtained string, start from the first Substract the arbitrary name to the char, we obtain the

  • riginal value

Go on the same If the obtained number is negative, then modulo was used, attacker just needs to substract this value.

Berner Fachhochschule | Haute ´ ecole sp´ ecialis´ ee bernoise | Berne University of Applied Sciences 12

slide-13
SLIDE 13

Recommendations

Berner Fachhochschule | Haute ´ ecole sp´ ecialis´ ee bernoise | Berne University of Applied Sciences 13

slide-14
SLIDE 14

Recommendations

Recommendations

Berner Fachhochschule | Haute ´ ecole sp´ ecialis´ ee bernoise | Berne University of Applied Sciences 14

slide-15
SLIDE 15

Use only Strong Crypto Algorithms

Do not create cryptographic algorithms

Only use approved public algorithms such as: AES, RSA public key cryptography and SHA-256 or better

Do not use weak algorithms

MD5 / SHA1 hash functions have been proven weak Favor safer alternatives such as SHA-256

Berner Fachhochschule | Haute ´ ecole sp´ ecialis´ ee bernoise | Berne University of Applied Sciences 15

slide-16
SLIDE 16

Handle Keys with extra Care

Generate keys offline and store private keys with extreme care

Never transmit private keys over insecure channels

Store if possible your private key encrypted

Using a pass-phrase Or in a Password Manager

Berner Fachhochschule | Haute ´ ecole sp´ ecialis´ ee bernoise | Berne University of Applied Sciences 16

slide-17
SLIDE 17

Protect Infrastructure Credentials

Data Base credentials

Use tight file system permissions and controls Encrypt securely credentials

Encrypted data should not be easy to decrypt

database encryption, useless if database connection pool provides unencrypted access

Berner Fachhochschule | Haute ´ ecole sp´ ecialis´ ee bernoise | Berne University of Applied Sciences 17

slide-18
SLIDE 18

PCI Data Security Standard

Berner Fachhochschule | Haute ´ ecole sp´ ecialis´ ee bernoise | Berne University of Applied Sciences 18

slide-19
SLIDE 19

PCI Data Security Standard

Payment Card Industry Data Security Standard

Developed by major credit card companies (e.g. Visa, Mastercard, American Express) to help organizations preventing credit card fraud

Must be implemented by any merchant using Credit Cards

A company processing, storing or transmitting payment card data must be PCI DSS compliant Risk: losing their ability to process credit card payment

Compliance must be validated periodically

Validation conducted by auditors (Qualified Security Assessors (QSAs) Smaller companies just fill a self-assessment questionnaire.

Berner Fachhochschule | Haute ´ ecole sp´ ecialis´ ee bernoise | Berne University of Applied Sciences 19

slide-20
SLIDE 20

PCI-DSS Requirements

Build and Maintain a Secure network

Install and maintain a firewall Do not use vendor-supplied default password and other security parameters

Protect Card-holder Data

Protect stored card-holder data Encrypt transmission of card-holder data across open, public networks

Maintain a Vulnerability Management Program

Use and regularly update anti-virus software Develop and maintain secure systems and applications

Implement String Access Control Measures

Restrict access to card-holder data by business need-to-know Assign a unique ID to each person with computer access Restrict physical access to card-holder data

Berner Fachhochschule | Haute ´ ecole sp´ ecialis´ ee bernoise | Berne University of Applied Sciences 20

slide-21
SLIDE 21

PCI-DSS Requirements (Cont.)

Regularly Monitor and Test Networks

Track and monitor all access to network resources and card-holder data Regularly test security systems and processes

Maintain an Information Security Policy

Maintain a policy that addresses information security

Berner Fachhochschule | Haute ´ ecole sp´ ecialis´ ee bernoise | Berne University of Applied Sciences 21

slide-22
SLIDE 22

PCI DSS - Storage of data

Card-holder Data

Primary Account Number (PAN, a.k.a. credit card number) Card-holder name Service Code Expiration Date Can be stored Require protection

Sensitive Authentication Data

Full Magnetic Stripe CVC2/CVV2/CID PIN Can in no case be stored

Berner Fachhochschule | Haute ´ ecole sp´ ecialis´ ee bernoise | Berne University of Applied Sciences 22

slide-23
SLIDE 23

Store only necessary data

Develop a data retention and disposal policy

Limit storage and retention time to which is required for business, legal, and/or regulatory

Protect PAN

Truncate card-holder data if full PAN is not needed Never send PAN in unencrypted e-mails Mask PAN when displayed

Render PAN unreadable anywhere it is stored

Strong one-way hash functions Truncation Index tokens and pads (pads must be securely stored) Strong cryptography with associated key management processes and procedures

Berner Fachhochschule | Haute ´ ecole sp´ ecialis´ ee bernoise | Berne University of Applied Sciences 23

slide-24
SLIDE 24

Conclusion

Berner Fachhochschule | Haute ´ ecole sp´ ecialis´ ee bernoise | Berne University of Applied Sciences 24

slide-25
SLIDE 25

Conclusion

Insecure Cryptographic Storage

No encryption of sensitive data Use of home-made “crypto” algorithms Use of weak algorithms

Protection

Use only proven strong algorithms Take care the way data are stored Encryption is useless if anybody knows the key!

PCI Data Security Standard

MUST HAVE for any merchant using credit-cards Describe security measures Verifies their implementation.

Berner Fachhochschule | Haute ´ ecole sp´ ecialis´ ee bernoise | Berne University of Applied Sciences 25

slide-26
SLIDE 26

References

OWASP Top 10 - 2007 http://www.owasp.org/index.php/Top_10_2007 A Guide for Building Secure Web Applications and Web Services http://www.lulu.com/content/1401012 Web Application Security Consortium: Threat Classification (2004) http://www.webappsec.org Wikipedia PCI DSS http://en.wikipedia.org/wiki/PCI_DSS PCI Security Standards Council (download PCI DSS) https://www.pcisecuritystandards.org/tech/ download_the_pci_dss.htm

Berner Fachhochschule | Haute ´ ecole sp´ ecialis´ ee bernoise | Berne University of Applied Sciences 26