๐ Lecture 23 โ HASH FUNCTION AND MESSAGE DIGEST
๐ Overview: This lecture introduces hash functions and message digests, explaining how they confirm message integrity in digital communications. It demonstrates the complete process of encrypting and digitally signing messages using public key cryptography, and discusses the Public Key Infrastructure (PKI) and key length concepts.
๐๏ธ Topics Covered
The lecture covers hash functions as one-way mathematical functions producing unique message digests for integrity verification. It explains the complete digital signature process involving message encryption, signing, and verification using public and private keys. The lecture also covers symmetric key usage with asymmetric cryptography for efficiency, Public Key Infrastructure (PKI) for certificate management, and the relationship between key length and possible key values.
๐ Lecture Summary
HASH FUNCTION AND MESSAGE DIGEST
Hash function is a one-way mathematical function applied to a message. The result of the hash function is unique to each message, called Message Digest. A message digest is a single large number typically between 128 to 256 bits in length. Thus, we can have up to 2^256 different messages, each having a unique message digest associated with it. A hash function is one way because we cannot go back to the original text by applying the hash function to a message digest. The concept of hash function and message digest is used to confirm the integrity of a message.
๐ Definition โ Hash Function: A one-way mathematical function applied to a message that produces a unique fixed-length value called a message digest.
๐ Definition โ Message Digest: A unique single large number (typically 128-256 bits) produced by applying a hash function to a message.
๐ Formula: Number of possible message digests = 2^(number of bits in message digest) โ Plain meaning: For a 256-bit hash, there are 2^256 possible unique message digest values, making collisions extremely unlikely.
Process of Sending Messages Using Public Key Cryptography
The sender types a text message, for example "Together, we shall make Pakistan strong...". A hash function is applied to get the message digest (e.g., "1967..."). The message is encrypted using the public key of the receiver, making it scrambled/confidential. The sender adds his private key to the message digest to create digital signatures. The receiver applies the public key of the sender to decrypt the digital signature and reveal the message digest. Then the receiver uses his private key to unscramble the message and applies the same hash function to get a message digest. The receiver compares both message digests; if identical, the message has not been altered.
๐ Example: Sender types "Together, we shall make Pakistan strong..."
- Hash function applied โ message digest = "1967..."
- Message encrypted with receiver's public key โ scrambled/confidential
- Sender's private key added to message digest โ digital signature created
- Receiver uses sender's public key โ reveals message digest
- Receiver uses own private key โ unscrambles original message
- Receiver applies hash function โ computes new message digest
- Both message digests compared โ if match, integrity confirmed
๐ก Why this matters: This process ensures both confidentiality (only receiver can decrypt) and integrity (message wasn't altered during transmission).
Steps in Digital Signature Process
- Hash function is applied to the original message to find the message digest.
- Public key of the receiver is used to encrypt the message.
- A digital signature is attached to the scrambled message by signing the message digest with the private key of the sender.
- The encrypted message, the digital signature, and the hash function are sent to the receiver.
- Public key of the sender is used by the receiver to reveal the message digest and confirm identity/authenticity. The receiver finds the digital certificate certifying the public key of the sender and checks whether the digital signature can be decrypted with the public key on the certificate.
- Receiver uses his/her private key (secret key only known to the user) to decrypt the message.
- Receiver applies hash function to the received original message and computes the message digest. If this matches the one from the sender, integrity is confirmed.
Symmetric Key Usage
A symmetric key can also be used for encrypting a message instead of public/private key pairs. The advantage is that symmetric algorithms are faster than asymmetric algorithms. To send the symmetric key to the receiver, asymmetric cryptography must be used. PGP (Pretty Good Privacy) uses this system.
Digital Signatures for Authentication Only
Where only authenticity is needed (not integrity), a name or a piece of text can be chosen to create digital signatures. For example, the word "Imran" can be used as a digital signature common for all different messages.
๐ Definition โ Digital/Electronic Signature: Considered more reliable than paper signatures because it is not ordinarily possible to copy or forge an electronic/digital signature, unlike paper signatures.
Public Key Infrastructure (PKI)
PKI is defined as a structured system that provides key management facilities, storage and management facilities of digital certificates, and involves a certification authority. PKI has applications in online contracts, e-banking, electronic payment systems such as electronic checks, credit card based systems, electronic cash, and micro payment systems.
๐ Definition โ PKI (Public Key Infrastructure): A structured system providing key management facilities, digital certificate storage and management, and involving a certification authority.
Key Length
A cryptographic key is represented as a string of binary digits (0's & 1's) inside a computer. If a key is 1 bit in length, there are two possible keys (0 and 1). A 2-bit key has four possible values (00, 01, 10, 11). A 3-bit key has eight possible values (000, 001, 010, 011, 100, 101, 110, 111).
๐ Formula: Number of possible keys = 2^(number of bits) โ Plain meaning: Each additional bit doubles the number of possible key values exponentially.
๐ Example: For a 128-bit key: 2^128 possible keys (an astronomically large number making brute-force attacks impractical)
โญ Key Takeaways
The most critical concepts are: hash functions are one-way mathematical functions producing unique message digests for integrity verification; the digital signature process involves encrypting with receiver's public key and signing with sender's private key; authenticity is verified using sender's public key via digital certificates from trusted certification authorities; symmetric keys are faster for encryption but require asymmetric cryptography for secure key exchange (as in PGP); and key length determines security strength since each additional bit doubles possible key values exponentially.
๐ง Quick Revision Questions
- What is the difference between a hash function and a message digest? Why is a hash function called "one-way"?
- In the digital signature process, which key encrypts the message and which key creates the digital signature?
- What are the seven steps involved in verifying both authenticity and integrity of a digitally signed message?
- Why is using a symmetric key for encryption combined with asymmetric key exchange considered efficient, and which system uses this approach?
- How does key length affect cryptographic security, and what is the formula for calculating the number of possible keys?
๐ Lecture 24 โ Symmetric Key Algorithms
๐ Overview: This lecture covers symmetric and public key cryptographic algorithms, including their key lengths and common attack methods. It then transitions into electronic payment systems, explaining the traditional credit card payment process and the Virtual PIN Payment System, which was an early internet payment method that avoided encryption.
๐๏ธ Topics Covered
This lecture discusses symmetric key algorithms like DES, IDEA, RC2, RC4, and Rinjdael, along with attacks on these algorithms including key search, cryptanalysis, and system-based attacks. It then covers public key algorithms such as DSS, RSA, and Elliptic Curves, and their associated attacks like key search and analytical attacks. Finally, it introduces electronic payment systems, detailing the traditional credit card payment process and the Virtual PIN Payment System.
๐ Lecture Summary
Symmetric Key Algorithms
Cryptographic algorithms are measured in terms of key length. Some popular symmetric key algorithms include DES (Data Encryption Standard) with 56 bits, IDEA (International Data Encryption Algorithm) with 128 bits, RC2 (a block cipher) with a key length of 1-2048 bits, RC4 (a stream cipher) with 1-2048 bits, and Rinjdael with 128-256 bits. The key length is a primary factor in determining the algorithm's strength against attacks.
Attacks on Symmetric Key Algorithms
Several types of attacks have been reported on symmetric key algorithms, including Key Search Attacks, Cryptanalysis, and System-based Attacks.
๐ Definition โ Key Search (Brute Force) Attacks: An attempt by the attacker to decrypt the message with every possible key. The greater the key length, the more difficult it is to identify the key.
๐ Definition โ Cryptanalysis: Encryption algorithms can be defeated by using a combination of sophisticated mathematics and computing power so that many encrypted messages can be deciphered without knowing the key.
๐ Definition โ System-Based Attacks: An attack made on the cryptographic system that uses the cryptographic algorithm without actually attacking the algorithm itself.
Public Key Algorithms
Popular public key algorithms include DSS (Digital Signature Standard based on DSA) with a key length between 512-1024 bits, RSA, and Elliptic Curves.
Attacks on Public Key Algorithms
Key Search Attacks attempt to derive the private key from its corresponding public key using the large composite number that links them. According to an estimate, a 1024-bit RSA public key may be factored due to fast computers by 2020. Unlike symmetric algorithms, increasing the key length in asymmetric algorithms does not significantly increase the difficulty for the attacker. Thus, a 128-bit RC2 symmetric key may prove to be much stronger than a 1024-bit RSA asymmetric public key.
Analytical Attacks use some fundamental flaw in the mathematical problem on which the encryption system itself is based to break the encryption. Quantum computing is the branch of computer science that deals with the development of cryptographic algorithms and can also be used to find flaws and launch attacks.
๐ก Why this matters: Understanding the different attack vectors on encryption algorithms is crucial for choosing appropriate security measures. The relative strength of symmetric vs. asymmetric keys highlights the importance of proper key management.
Electronic Payment Systems
Most electronic payment systems on the internet use cryptography to ensure confidentiality and security of payment information. Popular payment systems include credit-card based payment systems, electronic checks, electronic cash, and micro-payment systems (e.g., Milicent, Payword).
The Process of Using Credit Cards
The traditional process of paying through a credit card involves several steps:
- A potential cardholder requests an issuing bank to issue a card. The bank approves the application, and a plastic card is delivered by mail. The card is activated when the cardholder calls the bank and signs the back.
- The cardholder shows the card to a merchant to pay for a product or service.
- The merchant asks for approval from the brand company (e.g., Visa), and the transaction is paid by credit. The merchant keeps a sales slip.
- The merchant sends the slip to the acquirer bank and pays a fee. This is the capturing process.
- The acquirer bank requests the brand to clear the credit amount and gets paid.
- The brand asks for clearance from the issuer bank. The amount is transferred from the issuer to the brand, and the same amount is deducted from the cardholder's account.
Note: In a credit card, the issuer bank charges interest on the amount lent. In a debit card, no such interest is payable since the customer uses their own money.
Virtual PIN Payment System
The Virtual PIN Payment System is one of the earliest credit card-based systems launched for the internet in 1994 by First Virtual Holdings, Inc. This system does not involve encryption. Payment is made through a credit card, aiming to allow the selling of low-value information items without special client software or hardware.
Both merchants and buyers must register with First Virtual (FV). A buyer forwards their credit card details and email address to FV and receives a pass phrase called a Virtual PIN. The buyer calls FV to provide their credit card number, and FV links the Virtual PIN to the credit card number without using the credit card number on the network. A merchant goes through a similar process, providing bank details and receiving a merchant Virtual PIN.
The transfer takes place with the help of the Automated Clearing House (ACH) service, a centralized system connecting different banks electronically for clearing payment requests. Payment proceeds from the credit card issuer bank to the merchant's account via ACH, after FV deducts a per-transaction charge.
The working of the Virtual PIN system is as follows:
- A buyer browses a merchant's website and enters their Virtual PIN.
- The merchant queries the FV Internet Payment System Server (FVIPSS) to confirm the Virtual PIN.
- If the Virtual PIN is not blacklisted, the merchant acknowledges this by email, sends the goods, and sends transaction details to FV.
- The FV server emails the buyer asking if the goods were satisfactory. There are three possible answers:
- Accept: Payment proceeds.
- Reject: Goods not received or unsatisfactory; payment is not made.
- Fraud: Goods were never ordered; the FVIPSS immediately blacklists the Virtual PIN.
- A time period (minutes to days) is allowed for the buyer to respond. If no response, FV proceeds with payment.
๐ก Why this matters: A stolen Virtual PIN or credit card number can be used for bogus transactions before it is blacklisted, highlighting a security weakness in this payment system.
โญ Key Takeaways
Symmetric key algorithms like DES and IDEA are measured by key length, with longer keys offering greater resistance to brute-force attacks. Public key algorithms like RSA rely on mathematical problems for security, but their key lengths do not increase attack difficulty as much as in symmetric algorithms. Traditional credit card payments involve a chain of authorization from cardholder to issuer, acquirer, and brand, with interest charged on credit but not debit cards. The Virtual PIN system, an early internet payment method, avoided encryption by using a PIN tied to a credit card, but its security was vulnerable to theft and fraud if the buyer did not respond in time. Understanding these attack methods and payment workflows is essential for analyzing the security of e-commerce systems.
๐ง Quick Revision Questions
- What are the key lengths of DES and IDEA, and which one is considered more secure against brute-force attacks?
- What is the difference between a key search attack and cryptanalysis on a symmetric key algorithm?
- How does an analytical attack differ from a system-based attack on public key algorithms?
- List the six steps involved in a traditional credit card payment process from cardholder to merchant.
- In the Virtual PIN system, what happens if a buyer responds with "fraud" after an order?
๐ Lecture 25 โ Virtual PIN Payment System
๐ Overview: This lecture examines alternative online payment mechanisms beyond standard credit card processing, focusing on the Virtual PIN system, centralized account payment models, and electronic checks. Understanding these systems is crucial for recognizing the evolution of e-commerce payment methods and their respective security trade-offs.
๐๏ธ Topics Covered
The lecture covers three main payment systems: Virtual PIN payment system with its advantages and disadvantages, centralized account payment model where both parties hold accounts at the same online financial institution, and electronic checks using FSTC standards with symmetric/asymmetric cryptography, digital certificates, and smart card technology. It also details four processing scenarios for electronic checks through the Automated Clearing House (ACH).
๐ Lecture Summary
Virtual PIN Payment System
A Virtual PIN can become compromised as a result of eavesdropping and bogus purchases are possible before it is blacklisted. Stolen credit card numbers can also be used to set up Virtual PINs associated with email addresses controlled by the attacker to carry out bogus transactions. After every 90 days, the buyerโs credit card account is billed for the charges that have accumulated, and the merchantโs account is credited accordingly. The FV (First Virtual) system does accounting for the merchant and buyer; therefore, it takes a commission per transaction according to its policy.
Advantages and Disadvantages
Simplicity and no encryption is the biggest advantage of this payment system, which means that no special software is needed at the front end. This payment system is good for low-cost information items, such as online articles, journals, or music where the cost of items is not much. In that eventuality, only sales are lost rather than actual financial loss to the merchant if there is a fraud โ only some extra copies of the information items are made in case of fraud. On the other hand, the merchant is exposed to much greater financial loss if the purchase relates to actual physical goods.
One of the disadvantages is that pre-registration of the buyer and the merchant with FV is mandatory. Moreover, maintaining a bank account (in case of merchant) and having a credit card (in case of a buyer) is also essential. One can say that the merchant side is less secure because the goods are delivered by the merchant before the payment is actually received. The popularity of this payment system declined after 1998 mainly because of the introduction and development of encryption-based payment mechanisms.
๐ก Why this matters: The Virtual PIN system represents an early attempt at online payments that prioritized simplicity over security โ understanding its vulnerabilities helps appreciate why encryption became essential in e-commerce.
Centralized Account Payment Model
This is a popular payment system on the internet where both the payer (buyer) and the payee (merchant) hold accounts at the same centralized online financial institution. Over 20 payment systems use this approach, such as PayPal, E-gold, Billpoint, Cybergold, Yahoo! Pay Direct, and Amazon.com Payments.
Online opening/funding of oneโs account is done using a credit/debit card or prepaid cards. To make a payment, an account holder is authenticated using an account identifier and a password, along with the account identifier of the payee and the payment amount. All communication between the user and the bank is protected using SSL (Secure Socket Layer), which is an encryption-based protocol. The chosen account ID is unique within the system against which the funds are held in the online bank โ normally, unique email addresses are chosen as account identifiers.
Payees are notified by email of the payment, which they can confirm by viewing their account using SSL. A payee must open an account with the online centralized bank to receive the amount if no such account already exists. In some systems, a question may be sent to the payee to verify identity where the payer is not sure โ for instance, Yahoo Paydirect allows a payer-specified question to be sent to the payee's email. If the payer accepts the answer as proof of correct identity, the money is transferred; otherwise, the transaction is cancelled.
The centralized bank charges a transaction fee (depending on policy) from either the payer, payee, or both, on funding an account, withdrawing funds, or receiving payments. This model requires all participants to have their account with the same central payment system. The payee can eventually withdraw money received through Automated Clearing House (ACH).
๐ Definition โ SSL (Secure Socket Layer): An encryption-based protocol that protects all communication between the user and the bank in centralized account payment systems.
๐ Model: Payer โ Centralized Bank (SSL protected) โ Payee โ ACH โ Payer's external bank account
๐ Example: A buyer with a PayPal account pays a merchant who also has a PayPal account. The buyer authenticates with email and password over SSL. PayPal notifies the merchant by email. The merchant can withdraw funds to their regular bank account through ACH.
Electronic Checks
Financial Services Technology Consortium (FSTC) is a group of U.S. banks, research agencies, and government organizations formed in 1993. It introduced the concept of electronic checks. An electronic check contains an instruction to the payerโs bank to make a specified payment to a payee. Both symmetric and asymmetric cryptography are used. The payer and payee are issued digital certificates in X.509 standard format by their respective banks, used to verify digital signatures on the check. A bank may include account restrictions, maximum check value, or currencies allowed in the certificate.
All individuals capable of issuing electronic checks will have an electronic checkbook device, which is a combination of secure hardware such as a smart card and appropriate software. A smart card is usually the size of a credit card with special software loaded on it, storing information regarding the secret/private key, certificate information, and a register of what checks have been signed/endorsed.
The process works as follows:
- A payer uses the electronic checkbook device to generate a blank electronic check after filling information regarding amount, date, etc.
- The electronic check is digitally signed by the payer through their private key.
- A certificate issued by the payer's bank authenticating the public key of the payer is also attached.
- This information is sent to the payee in a secure envelope through email โ a secure envelope is created when a user encrypts information with a symmetric key, and then that symmetric key itself is encrypted with the receiver's public key.
- The payee decrypts the secure envelope by first retrieving the symmetric key (using their private key), then using that symmetric key to decrypt the electronic check.
- The payee endorses (counter-signs) the check using a secure hardware device such as a smart card.
- The endorsed check is forwarded to the payee's bank in a secure envelope.
- The bank clears the check with the help of traditional ACH.
- The payer's account is debited and the payee's account is credited.
- Banks send email statements to respective parties.
๐ Definition โ Secure Envelope: A method where information is encrypted with a symmetric key, and that symmetric key itself is encrypted with the receiver's public key, ensuring only the intended recipient can decrypt the contents.
๐ Example: A payer creates a $500 electronic check to a payee. The payer digitally signs it with their private key, encrypts it with a symmetric key, encrypts that symmetric key with the payee's public key, and emails it. The payee decrypts the symmetric key with their private key, then decrypts the check, endorses it with their smart card, and sends it to their bank. The bank uses ACH to transfer $500 from the payer's account to the payee's account.
Four Processing Scenarios for Electronic Checks
Depending on the availability of processing infrastructure, there are four different scenarios for processing an electronic check. EFT stands for "electronic funds transfer."
Fig. 3 Scenario (PayerโPayeeโPayee's BankโPayer's Bank):
- Payer writes and sends check to Payee
- Payee endorses and sends to Payee's Bank
- Payee's Bank notifies Payer's Bank via EFT
- Payer's Bank sends debit report to Payer's Bank's ledger
- Credit report sent to Payee's Bank
- Statement sent to Payee
Fig. 4 Scenario (PayerโPayer's BankโPayee's BankโPayee):
- Payer writes check and sends directly to Payee's Bank
- Payee's Bank processes EFT with Payer's Bank
- Payee's Bank sends accounts receivable update to Payee
- Statement sent to Payer
Fig. 5 Scenario (PayerโPayeeโPayer's BankโPayee's Bank):
- Payer writes check to Payee
- Payee endorses and clears through their Bank
- Payee's Bank handles accounts receivable update
- Statement sent to Payer
Fig. 6 Scenario (Direct Clear between Banks):
- Payer writes check
- Direct clear between Payer's Bank and Payee's Bank
- Accounts receivable update to Payee
- Statement to Payer
๐ Example: In Scenario 1 (full intermediary chain), a payer sends an electronic check to a payee; the payee endorses it and sends to their bank; the payee's bank notifies the payer's bank via EFT; the payer's account is debited; the payee's account is credited; both receive email statements.
โญ Key Takeaways
The Virtual PIN system offered simplicity with no encryption but was vulnerable to eavesdropping and fraud, making it only suitable for low-cost digital goods where fraud only results in lost sales rather than physical losses โ its decline after 1998 coincided with the rise of encryption-based payment mechanisms. The centralized account payment model, exemplified by PayPal, requires both parties to hold accounts at the same institution, authenticates via email/password over SSL, and settles through ACH, representing a significant evolution in online payment infrastructure. Electronic checks combine symmetric and asymmetric cryptography with X.509 digital certificates and smart card hardware to provide secure digital alternatives to paper checks, with the secure envelope technique ensuring confidentiality during transmission. The four processing scenarios for electronic checks (PayerโPayeeโPayee's BankโPayer's Bank; PayerโPayee's BankโPayer's BankโPayee; PayerโPayeeโPayer's BankโPayee's Bank; and direct bank-to-bank clearing) demonstrate flexible infrastructure options depending on processing capabilities. The key security innovation across all these systems is the transition from no encryption (Virtual PIN) to SSL-based protection (centralized accounts) to full public-key cryptography with digital signatures (electronic checks).
๐ง Quick Revision Questions
- Why did the Virtual PIN payment system decline in popularity after 1998, and what specific vulnerability made it unsuitable for physical goods?
- Describe the authentication process for making a payment in the centralized account payment model, including what information is required and what protocol protects the communication.
- What is a secure envelope in the context of electronic checks, and how does the recipient decrypt the contents?
- List the four different processing scenarios for electronic checks and identify which parties are involved in each scenario.
- What are the three types of information stored in the smart card component of an electronic checkbook device?
๐ Lecture 26 โ E-CASH PAYMENT SYSTEM
๐ Overview: This lecture introduces the e-cash payment system pioneered by DigiCash, focusing on its key feature of buyer anonymity. It explains the roles of the three participants (buyer, merchant, bank) and details the cryptographic processes of minting coins and making payments, using both symmetric and asymmetric cryptography.
๐๏ธ Topics Covered
The lecture covers the e-cash payment system, including its participants and the anonymity feature. It explains the structure and minting of e-cash coins, detailing the blinding process for anonymous bank signatures. The working model of e-cash is described, outlining the interactions between the client wallet, merchant software, and e-cash bank for withdrawing, paying, and validating coins.
๐ Lecture Summary
E-CASH PAYMENT SYSTEM
A company, DigiCash, pioneered the use of electronic cash or e-cash. The key feature of this system is the anonymity of the buyer. The three participants are the buyer, merchant, and bank. Both symmetric and asymmetric cryptography are used.
Buyers and merchants both have accounts in the e-cash bank. Buyers withdraw coins against their account and store them in e-cash wallet software (Cyber wallet) on their computer. The cyber wallet stores and manages coins and records every transaction. The merchant forwards coins to the e-cash bank, which ensures they have not already been spent and credits the merchant's account.
E-cash Coins
The currency used in this payment system is called an e-cash coin or simply coin. A coin consists of three elements: a serial #, a key version, and the serial no. signed by the secret (private) key of a certain denomination of the e-cash bank. In other words, a coin of one dollar would consist of the following:
๐ Definition โ E-cash Coin: A coin = Serial#, keyversion, {Serial #}SK (bankโs $1 key)
Each coin has a unique value, partly minted by the client and partly by the e-cash bank.
Minting of the coin
A long serial no. is randomly generated by the clientโs cyber wallet to mint a coin. This serial no. is blinded, meaning it is multiplied with a blinding factor โrโ and sent to the e-cash bank for signatures. Thus, the e-cash bank cannot see the serial no. it is signing. The key version (corresponding public key of the bank) is also part of the coin and is usually sent at the time of account opening. An e-cash bank may have a 1 dollar signature, 5 dollar signature, or 10 dollar signature, etc. If the client wants to mint a coin of 2 dollars, the e-cash bank would use its private/secret key of 2 dollars to sign the serial no.
๐ก Why this matters: This blinding process is the core mechanism that ensures buyer anonymity, a key feature distinguishing e-cash from other digital payment systems.
How bank signs blindly?
The cyber wallet generates a serial # and a blinding factor โrโ. This blinding factor โrโ is only known to the client. It is used in the following mathematical expression which is sent to the bank for signatures.
๐ Formula: Serial # . r^(e2) (mod m)
The public key of the bank consists of modulus โmโ and a number โeโ. The bank signs with its secret key of 2 dollars (d2) such that: (Serial # . r^(e2))^(d2) (mod m) = Serial#^(d2) . r^(e2d2) (mod m) (Serial # . r^(e2))^(d2) (mod m) = Serial#^(d2) . r (mod m)
The product of e2 and d2 cancel out each other due to the property of the inverse relationship of keys. The bank cannot see the serial # it is signing since it does not know โrโ. The expression โSerial#^(d2) . r(mod m)โ is sent back by the bank to the client, who divides it with โrโ to get the third part of a valid 2 dollar coin as follows:
๐ Formula: Serail#^(d2) . r(mod m) / r = Serial#^(d2) (mod m)
Thus, minting of a 2 dollar coin is completed. In a similar fashion, one can withdraw or mint coins of different denominations. The e-cash bank signs the serial nos. and debits the account of the client. A client must maintain their account with the bank. So, if a client has $50 in their account with the e-cash bank and requests coins of a total value of $10, the amount left in their account after the bankโs signatures on the serial nos. would be $40.
๐ Example: If a client has $50 and requests coins worth $10, the bank signs the serial numbers and the client's remaining balance is $40.
Working of the E-cash model
The client wallet or cyber wallet can generate serial nos., store coins, and make and accept payments. It can withdraw (get the coins minted) from the e-cash bank and deposit coins at the payment stage to the bank. The e-cash bank can issue new coins and send an account statement to the client. On the merchant side, there is special merchant software. Thus, a merchant can sell items, accept payments from clients, and also make payments. The e-cash bank signs the serial nos., maintains accounts of the client and the merchant, and also maintains a database in which the serial nos. of all such coins sent for payment are recorded.
The client makes the payment to the merchant for the items bought. The payment is made through e-cash coins. These coins were previously minted with the help of the e-cash bank and remain stored in the cyber wallet. The coins are encrypted with the public key of the bank and forwarded to the merchant for onward deposit to the bank. The merchant cannot, therefore, view these coins. The e-cash bank decrypts the coins using its corresponding private key and compares the serial nos., thus revealed, with its database of spent coins to check the validity of the coins. If a revealed serial no. is not contained in the database, it proves that the coin is valid and unspent. The bank then sends the valid indication to the merchant and adds that particular serial no. in its database to prevent any chance of its being consumed in the future. The merchant then sends the goods and receipt of payment to the client.
โญ Key Takeaways
The e-cash system ensures buyer anonymity through a cryptographic blinding process, where the bank signs a blinded serial number without seeing it. A coin consists of a serial number, a key version, and the serial number signed by the bank's private key for a specific denomination. The minting process involves the client generating a blinded serial number, the bank signing it blindly, and the client unbinding it to create a valid coin. During payment, coins are encrypted with the bank's public key, and the bank validates them by checking a database of spent serial numbers. This system prevents double-spending while maintaining the privacy of the buyer.
๐ง Quick Revision Questions
- What is the key feature of the e-cash payment system?
- List the three participants in the e-cash system.
- What are the three elements that make up an e-cash coin?
- What is the purpose of the blinding factor 'r' in the minting process?
- How does the e-cash bank check the validity of a coin during a payment transaction?
๐ Lecture 27 โ E-CASH PAYMENT SYSTEM
๐ Overview: This lecture explains the e-cash payment system, focusing on how anonymity is maintained between the minting and deposit stages. It covers the complete lifecycle of e-cash coinsโfrom withdrawal, through purchase and payment, to deposit and dispute resolutionโmaking it essential for understanding privacy-preserving digital payments.
๐๏ธ Topics Covered
The lecture covers anonymity mechanisms in e-cash, the process of withdrawing coins from the bank, the e-cash purchase flow including payment requests and cyber wallet assembly, how payment is made and proven using payer codes, the deposit and double-spending prevention process, recovery of lost coins after network failure, and the web-based architecture for e-cash transactions.
๐ Lecture Summary
How anonymity is ensured in e-cash payment system?
Anonymity in e-cash means that the identity of the client/buyer is not disclosed. There are two main stages: the minting stage and the deposit stage. At the minting stage, the serial number is signed by the e-cash bank to create a valid e-cash coin. The bank knows which client is requesting the signature but does not know the serial number due to the blinding factor โrโ. At the deposit stage (when coins are sent for validation), the bank knows the serial number (which it earlier signed blindly) but has no clue which specific client sent them. Since the bank issues coins to many clients, it cannot identify which client made the payment. Thus, the relationship between client and serial number is broken across these two stages.
๐ Definition โ Blinding factor (r): A random value used to conceal a serial number from the bank during minting, so the bank signs the blinded serial number without knowing its actual value.
๐ Example: At minting: Serial number (unknown), Client (known). At deposit: Serial number (known), Client (unknown). This reversal ensures the clientโs identity is never linked to the spent coin.
Withdrawing Coins
Many coins of different denominations can be obtained in a single request to the bank. The request is signed by the client with his private key and contains information about the serial numbers to be signed. The request is encrypted with a symmetric key, and that symmetric key is encrypted with the public key of the bank, creating a secure envelope. The bank signs the serial numbers to mint coins of requested denominations and forwards them to the client/buyer.
E-cash Purchase
Having received an order, the merchant sends a payment request to the client in the following format:
Payreq={currency, amount, timestamp, merchant_bank ID, merchant_accID, order description}
The cyber wallet automatically assembles the correct payment amount and pays.
Making the Payment
Coins used in the payment are encrypted with the bankโs public key, preventing the merchant from viewing them. Payment information is forwarded to the bank with encrypted coins during the merchant's deposit. Only a hash of the order description is included in the payment information, preventing the bank from knowing the order details.
Proving the Payment
A payer code is a secret generated by the client. A hash of it is included in the payment information so that the client can later prove the payment if need be. For instance, the client may choose the word โBlueskyโ as a code. By applying a hash function on this code, a message digest is obtained. Both the hash function and message digest are sent to the bank. If a dispute arises, the payer can forward the word "Bluesky" to the bank and request it to apply the hash function. If the resulting message digest matches the one stored earlier, it proves that the person claiming to be the payer made the payment.
๐ Definition โ Payer code: A secret value chosen by the client to prove authorship of a payment later. Only its hash is sent to the bank.
๐ Example: Client chooses "Bluesky", hashes it to get a message digest, and sends both to the bank. To prove payment, client sends "Bluesky" again โ bank hashes it โ if digest matches, identity is confirmed.
Payment Deposit
A deposit request encrypted with the bankโs public key accompanies the payment information. The e-cash bank maintains a database of spent coins. On receipt, it checks whether the coin is valid and whether it has already been spent (to prevent double spending) by referring to its database. If the coins are valid, the bank credits the merchantโs account. For example, if the client sent valid coins worth $10 and the merchant already has $90, the merchantโs account becomes $100. Later, the merchant can request the e-cash bank to transfer this amount to his account with the acquirer bank via ACH (Automated Clearing House), and then physically withdraw the money.
The e-cash bank plays a backbone role and charges a specified commission from the client and merchant depending on its policy.
Lost Coins
In case of network failure or computer crash during a payment transaction, coins might be lost. The bank sends all signed blinded coins from the last 16 withdrawals to the client. The client uses the blinding factor (known to their wallet) to reveal the serial number of each coin. The client then sends all serial numbers to the bank for verification of whether or not the coins have already been spent. After checking its database, the bank credits the clientโs account with the value of unspent coins.
E-Cash & the Web
Fig. 2 shows how e-cash payment can be applied on the web: Client wallet and web browser are installed on the client machine; web server software and merchant software are installed on the server machine. The client selects an order, and the web server starts the merchant software/wallet (steps 1 & 2). A payment request is made by the merchant software, and the client wallet pays using e-cash coins (steps 3 & 4). The merchant deposits the coins to the e-cash bank for validity checking (step 5). If valid, an acceptance message is sent to the merchant, followed by a receipt of payment to the client (steps 6 & 7). The merchant software then instructs the web server to send goods, which acknowledges the fact to the web browser (steps 8 & 9).
๐ก Why this matters: This architecture demonstrates how e-cash integrates with standard web technologies while maintaining privacy and security across all transaction stages.
โญ Key Takeaways
Anonymity in e-cash is achieved by separating knowledge of the client's identity (known only at minting) from knowledge of the serial number (known only at deposit), breaking the link between them. The blinding factor 'r' is the cryptographic tool that enables this separation. E-cash supports batch withdrawals, encrypted payments, payer codes for proof of payment, and a deposit system with double-spending prevention via a spent-coin database. Lost coins can be recovered using the last 16 withdrawals and the clientโs blinding factor. The web-based architecture relies on client and merchant software with an e-cash bank as the central clearing authority.
๐ง Quick Revision Questions
- How does the blinding factor "r" ensure anonymity for the client at both the minting and deposit stages?
- What information is included in the merchant's payment request (
Payreq) to the client? - In what format are coins sent during payment, and how does this prevent the merchant from viewing their value?
- How can a client prove they made a specific payment using the payer code mechanism?
- What steps are taken to recover lost e-cash coins after a computer crash or network failure?