Kajihiro Kazunori
#kichijojirb
Payment Card Industry Data Security Standard
PCI DSS provides a baseline of technical and operational requirements designed to protect cardholder data.
Payment Card Industry Data Security Standard
3.4 Render PAN unreadable anywhere it is stored (including on portable digital media, backup media, and in logs) by using any of the following approaches:
Payment Card Industry Data Security Standard
3.5.2 Store secret and private keys used to encrypt/decrypt cardholder data in one (or more) of the following forms at all times:
So, we should have 2 types of key
The AWS Key Management Service (AWS KMS) is a managed service that makes it easy for you to create and control the encryption keys used to encrypt your data.
client = Aws::KMS::Client.new
### Generating data key
resp = client.generate_data_key(key_id: "c4daa226-...",
key_spec: "AES_256")
Base64.encode64(resp.plaintext)
#=> "m4Qi66NvmLlV5ut8Qxiw/qA1q0vt2yadjqp6YhHthmA=\n"
encrypted_data_key = Base64.encode64(resp.ciphertext_blob)
#=> "CiDFJioCMK4fkTzvs2KVLh737rxUi3bT0GsQkCpsiT3nxhKnAQEBAwB4xSYq\nAjCuH5E87..."
### Decrypting encrypted data key
resp2 = client.decrypt(ciphertext_blob: Base64.decode64(encrypted_data_key))
Base64.encode64 resp2.plaintext
#=> "m4Qi66NvmLlV5ut8Qxiw/qA1q0vt2yadjqp6YhHthmA=\n"
Code Example
Stores
Stores
KMSを使えばセキュアなシステムを簡単に構築できます