Professional Documents
Culture Documents
ONLINE TRANSACTIONS
Course Instructor :-
Prof. Manish K. Gupta
Group :-
1
Contents
1 Introduction 4
2 Visual Cryptography 4
2.1 What is visual cryptography? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2 How visual cryptography works? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.3 Advantages and disadvantages of visual cryptography . . . . . . . . . . . . . . . . . . . . . . 9
2.3.1 Advantages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.3.2 Disadvantages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2
1 Introduction
Online transactions are an integral component of every day life as the world gets more digital. Online
purchases are handy however they also come with a risk of fraud and online crimes. To address this issue,
various methods of secure transactions have been developed, including encryption and digital signatures.
Visual cryptography is one innovative technique for ensuring online transactions are secure.
Visual cryptography is a cryptographic technique that allows for the secure transmission of information
through visual means. It uses the properties of human vision to encrypt information, making it unreadable
to anyone without the appropriate decoding tools. Due to its potential for application in safe online trans-
actions, visual cryptography has attracted a lot of attention recently.
The idea of visual cryptography and how it is used in online transactions will be covered in this piece
of writing. We will investigate the application of visual cryptography to strengthen online transaction secu-
rity and increase their resilience to online attacks. We will also look at drawbacks and potential advancements
in the future.
2 Visual Cryptography
2.1 What is visual cryptography?
Visual cryptography is a method of encoding a secret message into a number of pictures or images also called
shares to enable the secret sharing of information. The shares are given out to various people, and the secret
message is revealed only by carefully combining the shares. Pixel expansion, which is the method of storing
one bit of secret information in numerous pixels of two or more shares, is the foundational idea of visual
cryptography. To someone who is unaware of the secret, the generated images seem random and meaningless,
but when the shares are superimposed, the original hidden message is revealed. Secure image transmission,
digital watermarking, and secure authentication are just a few of the uses for visual cryptography.
import numpy a s np
def e n c r y p t ( img ) :
width , h e i g h t = img . s i z e
# t h r e s h o l d v a l u e f o r b i n a r i z a t i o n o f image
t h r e s h o l d = 128
3
# B i n a r i z e image
img = b i n a r i z e ( img , t h r e s h o l d )
# s h a r e 1 and s h a r e 2
share1 = [ ]
share2 = [ ]
fo r x in range ( h e i g h t ) :
s h a r e 1 . append ( [ ] )
s h a r e 2 . append ( [ ] )
3. Now we will convert original image to 2 Image using original image and randomised varible z.
4. This 2 image individually do not contain any information.
fo r x in range ( h e i g h t ) :
fo r y in range ( width ) :
# S e l e c t i n g random number 0 or 1
z = randint (0 ,1)
# Encryption algorithm
i f ( img [ x ] [ y ]==1):
i f ( z ==1):
share1 [ x ] . i n s e r t (y , 1 )
share2 [ x ] . i n s e r t (y , 1 )
else :
share1 [ x ] . i n s e r t (y , 0 )
share2 [ x ] . i n s e r t (y , 0 )
else :
i f ( z ==1):
share1 [ x ] . i n s e r t (y , 1 )
share2 [ x ] . i n s e r t (y , 0 )
else :
share1 [ x ] . i n s e r t (y , 0 )
share2 [ x ] . i n s e r t (y , 1 )
#C o n v e r t i g s h a r e 1 & s h a r e 2 i n t o numpy a r r a y
s h a r e 1 = np . a s a r r a y ( s h a r e 1 )
s h a r e 2 = np . a s a r r a y ( s h a r e 2 )
4
5. Again we are Converting Both share 1 and share 2 to greyscale image.
6. Since both together contain information, we do not store two shares on the same space. Instead, we
typically provide the user 1 share (using the same algorithms as the locker).
i f s h a r e 2 . g e t p i x e l ( ( x , y ) ) == 1 :
share2 . putpixel (( x , y ) ,255)
else :
share2 . putpixel (( x , y ) ,0)
return s h a r e 1 , s h a r e 2
1. Share 1 2. Share 2
• One share will be with User while other will be stored to system.
• how to superimpose this 2 image to get our original back is explained in Decryption function below.
5
Decryption Function ( Python Code )
1. We First convert Grey scale encrypted (Share 1 and Share 2) to binary image in order to process
throughout Decryption algorithm.
def d e c r y p t ( s h a r e 1 , s h a r e 2 ) :
width , h e i g h t = s h a r e 1 . s i z e
i f s h a r e 2 . g e t p i x e l ( ( x , y ) ) == 2 5 5 :
share2 . putpixel (( x , y ) ,1)
else :
share2 . putpixel (( x , y ) ,0)
2. We then Superimpose Share 1 and Share 2 following below Rules to get back orignal image in binary
Form.
# Decryption algorithm
fo r x in range ( h e i g h t ) :
fo r y in range ( width ) :
i f ( s h a r e 1 [ x ] [ y]== s h a r e 2 [ x ] [ y ] ) :
decrypted [ x ] . i n s e r t (y , 0 )
else :
decrypted [ x ] . i n s e r t (y , 1 )
6
3. Again we are Converting Decrypted image to greyscale.
4. We have decrypted Image which can be compare from below image.
how it is implemented?
While implementing visual cryptography, a secret message is encoded into several shares or images using
pixel expansion. The shares are distributed to various people, and the secret message is revealed only by
carefully combining the shares. How visual cryptography works is as follows:
1. Encoding the Secret Message: The secret message is broken up into bits, and each bit is encoded via
pixel expansion into two or more shares. Encoding numerous pixels of two or more shares with a single
secret bit of information is referred to as "pixel expansion." To someone who does not know the secret,
each sharing is a black-and-white image that seems random and meaningless.
2. Distributing the Shares: The shares are distributed to different individuals. A two-out-of-two visual
cryptography technique, for instance, distributes one share to each person, and the secret message can
only be decoded by superimposing the two shares.
7
3. Superimposing the Shares: The individuals superimpose the shares by overlaying them on top of each
other to reveal the secret message. The original hidden message may be seen when the shares are lined
up properly, while the remaining pixels appear random and meaningless.
2.3.1 Advantages
1. Simple and easy to implement: Visual cryptography is a simple and easy-to-implement cryptographic
technique that does not require complex algorithms or keys.
2. No computational resources needed: Unlike other cryptographic techniques, visual cryptography does
not require any computational resources, making it ideal for use in low-resource environments.
3. No risk of key exposure: Visual cryptography does not require the use of a secret key, which eliminates
the risk of key exposure or loss.
4. No mathematical expertise required: Visual cryptography does not require any mathematical expertise,
making it accessible to a wide range of users.
5. Robustness: Visual cryptography is robust against brute-force attacks and other forms of cryptographic
attacks.
2.3.2 Disadvantages
1. Increased storage and transmission requirements: Visual cryptography requires multiple shares, which
increases the storage and transmission requirements in large scale.
2. Limited secret message size: The size of the secret message that can be encrypted using visual cryp-
tography is limited by the number of shares used.
3. Vulnerable to attacks: Visual cryptography is vulnerable to attacks that can reveal the secret message
if an attacker has access to a sufficient number of shares.
4. Limited applications: Visual cryptography is limited to applications that require the sharing of visual
information, such as images or text.
5. Low level of security: Visual cryptography provides a low level of security compared to other crypto-
graphic techniques, such as public-key cryptography or symmetric-key cryptography.
Overall, visual cryptography is a simple and easy-to-implement cryptographic technique that is suitable
for certain applications. However, it is important to carefully consider its limitations and vulnerabilities
when selecting a cryptographic technique for a particular application.
8
3 Applications of Visual Cryptography in Online Transactions
Here is the breif explanations of how visual cryptography can be used in different ways in online transactions.
9
2. Password protection: It is possible to utilise
visual cryptography to secure passwords when
making purchases online. For instance, a website
might divide a password into two or more photos
and send them to the user’s email or phone using
visual cryptography. The password can then be
revealed by appropriately combining the photos.
flow diagram
1. Login system: The user logs into the online platform using their login credentials to access their
account.
2. Visit store and add items to cart: The user browses the online store and adds items to their cart.
3. Add card no and other information: The user provides their payment information, such as credit card
number, billing address, and other details required for payment processing.
4. Information checking in payment portal: The payment portal checks the validity of the user’s payment
information, ensuring that the information is accurate and matches the user’s billing information.
5. Account verification in bank: Before processing the payment, the user’s bank verifies their account to
ensure there are sufficient funds and that the payment is authorized. Merchant receives a payment
capture token from the payment portal. A payment capture token is a sign that the merchant has been
authorised to accept payments.
6. Transfer of funds: The user selects the items they want to purchase and initiates a payment to the
merchant by transferring funds from their account to the merchant’s account.
7. To request payment for a purchase, a merchant provides the payment capture data they obtained from
the payment portal. The payment portal verifies the data the merchant supplied for payment capture.
The payment is sent to the retailer if it is verified by the payment portal.
10
• Drawbacks : The consumer is unsure with the mentioned existing payment method if his PIN number
and CVV number are forwarded to the merchant’s webpage. One must have faith in the vendor and its
cardholder data to be used by staff members for personal gain. High level security is not supported by
this illustration. The merchant may be required to comply with PCI standards as part of the solution,
but this would take time.
flow diagram
1. Login system: The user logs into the online platform using their login credentials to access their
account.
2. Visit store and add items to cart: The user browses the online store and adds items to their cart.
3. Add card no and other information: The user provides their payment information, such as credit card
number, billing address, and other details required for payment processing.
4. Creation of two shares using visual cryptography: The user’s payment information is encrypted using
visual cryptography, which generates two shares. One share is kept by the user, and the other share is
sent to the CA.
5. Keep one share to user and send another to CA: The user keeps one share, while the other share is
sent to the CA to ensure secure decryption of the payment information.
6. Certified authority: The CA verifies the user’s information and decrypts the user’s share using their
own share and the user’s share to retrieve the payment details.
7. CA gets information by doing decryption using his share and user’s share: A certified authority (CA)
is involved in the transaction to ensure security. The user’s information is encrypted using visual
cryptography, which generates two shares. One share is kept by the user, and the other share is sent
to the CA. CA decrypts the information using his share and user’s share.
8. Transferring funds from customer’s account to merchant’s account: The user selects the items they
want to purchase and initiates a payment to the merchant by transferring funds from their account to
the merchant’s account.
11
4 Limitations of Visual Cryptography
12
References
[1] Trihastuti Yuniati and Rinaldi Munir. Secure e-payment method based on visual cryptography. In 2018
3rd International Conference on Information Technology, Information System and Electrical Engineering
(ICITISEE), pages 130–135, 2018.
[2] Souvik Roy and P. Venkateswaran. Online payment system using steganography and visual cryptography.
pages 1–5, 03 2014.
[3] E –payment system using visual and quantum cryptography. Procedia Technology, 24:1623–1628, 2016.
International Conference on Emerging Trends in Engineering, Science and Technology (ICETEST - 2015).
[4] Wikipedia contributors. Visual cryptography — Wikipedia, the free encyclopedia, 2022. [Online; accessed
1-May-2023].
13