Exercise: Anonymizing and Encrypting the Data
Practice anonymizing and encrypting sensitive credit card data.
Data anonymization
Consider a dataset containing credit card transaction details of a bank's customers. The transactions are ATM deposits and withdrawals collected in real time as they happen. When a customer uses their credit card to withdraw or deposit money from an ATM, the transaction details are recorded in the dataset and stored in the bank’s database.
Our job is to anonymize the dataset to protect the customer’s credit card data. The dataset contains the following columns:
Customer ID
: A unique identifier for each customerTransaction ID
: A unique identifier for each transactionCredit Card Number
: The credit card number of the customerType
: The type of transactions; deposit or withdrawalAmount
: The amount deposited or withdrawn in the transactionBalance
: The balance after the transaction
Let’s load a sample dataset into a pandas DataFrame:
Get hands-on with 1200+ tech skills courses.