Abstract— This paper gives

a brief overview of using SHA (Secure Hashing Algorithm) for Video files. Recently, the

most widely used hash function has been the Secure Hash Algorithm, because

virtually every other widely used hash function have been found to have substantial

cryptanalytic weakne . SHA was more or less the last remaining standardized

hash algorithm by 2005 . SHA (Secure Hashing Algorithm) originally developed by

National Security Agency (NSA) and later handed over to National Institute of

Standard and Technology (NIST) are a way to ensure information security. They are typically used in digital signature

and in connections with secure websites. Data that is run through a hash algorithm produces shorter string of bits; this string

acts as a kind of digest of the data. Any changes to the

data changes the bit string resulting string therefore acts as a finger

print of the data, guaranteeing that no one has tempered with it. However having algorithm like SHA for only

text and images is a waste it’s potential.

Keywords—Message

digest; Hash function; Video security

I.

Introduction

Secure Hashing Algorithm is a method or

process through which a message is converted into smaller size that is it is

compressed it uses message digest algorithm for converting the variable length

data into fixed length data and then it creates a hash value of the data of 16

bit length thus when the data file is opened it will require the hash value or

figure print to open the data file. Image hash function have become an important field of research for past

few years earlier hash functions was used to provide security for text in SSL

certificates, Image hash functions map images to short binary strings in order

to facilitate comparisons and researches this functions have property that two

images which look same will have same hash value with small bit-level

differences 4. Video file in regard to this paper

for the receiver to view the video file. Video is a collection of data or

information in itself for compressing it and then creating a hash value or

figure print of it and maintain its quality at the same time is a difficult

task which is what this algorithm is trying to achieve.

II.

Literature Survey

A cryptographic hash function takes a message of

arbitrary length and creates a message digest of fixed length 1. A hash function needs to create a fixed size digest out

of a variable-size message. Multi-collisions in Iterated Hash Functions paper

is written by Antoine Joux in DCSSI Crypto Lab(France), This paper helped us to study the existence of

multi-collisions in iterated hash functions 5. It helps us to know that finding the multi-collisions

are tougher to find than the ordinary collisions, it also tell us about the

complexities of the attacks on the system 5. It also mentions that the system has to satisfy

various security properties and in case of an attack to the system ,the system

will be immune to the attack and not let data get stolen from the system,It suggests that the building of a multi-collision system

will be very difficult with an input of variable size 5. The system has to use a compression function whose input sizes are fixed

which is SHA-1 5. A combination of cryptography using AES and

steganography are used for security 6. To increase the security level, the key are

hashed using SHA-1.In this method an advanced concept of combining

cryptography and steganography in image and audio 6. SHA-1 algorithm is used

for encryption and compression for data using 512 bit block size sequentially

7. The new attack on SHA Algorithm has reduced probability and complexity 3.

It has also been presented a chosen-message pre-image attack on MD4 with

complexity below 28 3. By literature survey the question of how SHA is

performed is clear but it has not been proposed for video.

III.

Secure Hashing Algorithm

Message Digest or Fingerprint is the best method to provide

security as it is the condensed representation

of the data so its size is less as compared

to the original data and it is easy to generate for a given file. It is computationally infeasible to produce two messages

with same message digest. It is also impossible

to recreate a message given a message digest. It provides data integrity

and comparison checking as well as

message integrity validation. It

uses one-way hash functions for generating the hash value of the data. In Public Key Algorithms it is used for password logins, encryption key management, digital signatures, integrity checking, virus and malware scanning, authentication, secure web connections i.e. PGP, SSL.

IV.

Methodology

A. Video to image conversion

Using the algorithm directly on the

video files will be a very complex computation so to achieve this task very

easily and simply the video files should be first converted into frames and then

after converting it into frames after an interval of just suppose 0.2 sec the

image will be formed by using a for loop and ‘imwrite’ command

from o to 255 i.e. in both direction (rows and columns) as the video is a 2D

representation of 3D object and image is also 2D representation.

B. Colour image to gray

Colour image contains a large number of

pixel value as compared to grayscale image so it would be easier to operate or

perform hash functions on grayscale image so convert the image into gray image

by using a for loop as used above. The coloured

image is the converted into greyscale image this is because the luminance of a

pixel value of a grayscale image ranges from 0 to 255 8.The conversion of a

colour image into grayscale image is converting the rgb values(24bit) into

grayscale value (8bit) for simplycity 8. By converting the colour image or

Rgb into gray we enter into a domain which is much easy for processing and

computation complexity reduces as there are less information present.

C. Append Padding

Bits

First calculate the length of the

message but here the message is a video file which is converted into image

frames or to be precise grayscale image’s which is of 8 bit so first convert it

into 8 parts from MSB to LSB 2. After that message is padded with a 1 and

as many 0’s as necessary to bring the message length to 64 bits fewer than an

even multiple of 512 2. To make

the length congruent to 448 modulo 512.

D.

Append Length

The data is then a fixed length of 448

bits which is 64 less than 512. Then 64 bits are appended to the end of the

padded message. These bits hold the binary format of 64 bits indicating the

length of the original message 2. The output of the first two steps is a message that is an integer

multiple of 512 bits in length in this case image of 512 bits block 2.

E.

Prepare Processing Functions

SHA requires 80 processing functions that are defined below which are used

for various processing to be computed on the raw image for the protection or

security of the data by the eves-dropper or from any unauthorized access by

using these various defined processing Secure hashing Functions 2:

F (t;B,C,D) = (B AND C) OR ((NOT B) AND D)

( 0

<= t <= 19) (1)
F (t;B,C,D) = B XOR C XOR D
(20 <= t <=
39) (2)
F (t;B,C,D) = (B AND C) OR (B AND D) OR (C AND D)
(40 <= t <=59) (3)
F (t;B,C,D) = B XOR C XOR D
(60 <= t <= 79) (4)
F.
Prepare Processing Constants
SHA requires 80 processing constant words defined as 2:
K(t)
= 0x5A827999 ( 0
<= t <= 19)
K(t)
= 0x6ED9EBA1 (20 <=
t <= 39)
K(t)
= 0x8F1BBCDC (40 <=
t <= 59)
K(t)
= 0xCA62C1D6 (60 <=
t <= 79)
G. Initialize Buffers
SHA requires 160 bits or 5 buffers of words (32 bits) for holding the
intermediate data and the final hash value the following are the registers
which are initialized to 32 bits (hexadecimal values) 2. In 1024 bit SHA
algorithm the bit requirement doubles and so does the buffers capacity for
storing data. Some of the buffers are given below 2:
H0 =
0x67452301
H1 =
0xEFCDAB89
H2 =
0x98BADCFE
H3 =
0x10325476
H4 =
0xC3D2E1F0
H. Processing
Message in 512-bit blocks
This is the main task of SHA algorithm
which loops through the padded and appended message in 512-bit blocks 2. After all the above steps the
images are ready in 512 bit block size for processing in the round function and
generation of the hash value.
Input and predefined functions:
·
M1, 2, ..., L are Blocks of
the padded and appended message
·
F (0;B,C,D), F (1,B,C,D), ...,
F (79,B,C,D) are 80 processing functions
·
K(0), K(1), ..., K(79) are 80
Processing Constant Words
·
H0, H1, H2, H3, H4, H5 are word
buffers with initial values
The picture
shown below shows process of Message digest generation using SHA-512 1.
Fig 1: Messsage digest generation
I. Steps for Round Function
Various logical operators
like and, or, xor and various bit wise operators are used like rotation
operator for the processing in the round function 2. As the image is divided
into blocks of 512 bit size so when the first hash value is generated it is
xored with the next data in these round function for further processing and
thus so on the lastly the last output which is generated is the final hash
value which is stored in the intial buffer 2. The below given are some steps
to be followed in the round function 2:
For loop on k =
1 to L
§
(W(0),W(1),...,W(15)) = Mk then
divide Mk into 16 words.
For t = 16 to 79
§ W(t) = (W(t-3) XOR W(t-8) XOR W(t-14)
XOR W(t-16)) <<< 1
§ A = H0, B = H1, C = H2, D = H3, E =
H4
For t = 0 to
79
§ TEMP = A<<<5 + F (t;B,C,D)
+ E + W(t) + K(t) E = D, D = C,
§ C = B<<<30,B = A,A = TEMP
§ End of for loop
§ H0 = H0 + A, H1 = H1 + B, H2 = H2 +
C, H3 = H3 + D, H4 = H4 + E
§ End of for loop
V.
Discussion
By performing this algorithm on the
video file we are expecting the following result that is the video file will be
compressed and it will ask for a hash key or finger print for opening the data
file.
The below
given flow chart shows a simplistic step by step procedure for the Secure
Hashing Algorithm for video. As discussed above first we have to convert the
video into frames of image for simplistic operation and that to into the gray
domain which has only 0 to 255 pixel values for simplicity of operation. The
conversion of a colour image into grayscale image is converting the RGB values (24bit)
into grayscale value (8bit) for simplicity 8. But the image still is a 8 bit
image so we have to convert the image into 1 bit 8 image using bit plane
slicing and then start the further processing on that one bit image by padding
first one's and then zero's until a block size of 448 bits is been formed and
in remaining 64 bits the length of each image is padded separately. The hash value generated after
processing of these 1bit individual images will be XOR with the pre-processing
functions and pre-processing constant in-order to get a final Hash value which
will be transferred as mentioned above to the destination address.
Fig 2: Flow chart for SHA for Video
The video is first converted
into 25 frames per second by using codes
in the matlab. The size of the coloured image is shown in fig 2 and 3 which is
an unsigned integer 8 image.
Fig 3: Colour image frames
Fig 4: colour image frame
specification
The
coloured image is the converted into greyscale image this is because the
luminance of a pixel value of a grayscale image ranges from 0 to 255. The
conversion of a colour image into grayscale image is converting the RGB
values(24bit) into grayscale value (8bit) for simplycity 8, which is shown in
fig 4 below.
Fig 5: Grayscale image
The matlab code
output of the first two steps is obtained which is shown in fig 5 below
Fig 6: Matlab output window for
first 2 steps
The matlab output obtained after padding first
1 and then with however amount of zero's required inoder to make the message
length 64bits less than 512 bits which is 448 bits so that in last 64 bits length
of message can be appended , it is as shown below in fig 6 .
VI. Conclusion
Thus we conclude for
having a SHA securing algorithm for video by generating a message digest of a
video by first converting it to images and then applying algorithm on each
image separately and combining them to get a compressed output along with a hash
value which is unique and is impossible for a intruder to get the original
message even if he has a unauthorized access to the message digest or the compressed
message.
Acknowledgment
We are foremost
thankful to the Principal of our college Dr. B. K. Mishra who has taken
strenuous efforts in providing us with excellent lab facilities. We are greatly
indebted to our internal project guide Prof. Rashmitakumari
Mohapatra for her able
guidance and enlightened comments, which has helped us in better understanding
our project work. We would like to thank Mrs. Dr. Sangeeta
Mishra for her helpful suggestions
and numerous discussions with which she has guided us. We are also thankful to our Head of Department Prof. Vineet Dongre and Project Co-coordinator Prof. Manoj Chavan
who has given us constant motivation, guidance and encouragement for the
project. We are also grateful to our classmates and friends who have given us
feedback and encouragement. Finally we would wish to thank our college Thakur
College of Engineering and Technology for providing us with a platform and the
necessary facilities to make this project.
References
1 Behrouz
A Forouzan, Debdeep Mukhopadhyay, "Cryptography And Network Security", 2nd ed.
McGraw Hill Education, India, 2013, ch. 12, sec. 3, pp. 327–354.
2 2William
Stallings, "Cryptography And Network Security", 3rd ed. Pearson Education,
India: PLC, 2004, ch. 11, sec. 2, pp. 328–334.
3 3Xiaoyun
Wang et al., "Cryptanalysis of the Hash Functions MD4 and RIPEMD", Advances in
Cryptology-Eurocrypt, 2005.
4 M. Johnson, Kannan
Ramchandran, "Dither-based secure image hashing using distributed
coding"International Conference on Image Processing,2003.
5 Antonie
Joux,"Multicollision in iterated hash function A to cascaded constructions",
DCSSI Crypto Lab, France, 2004.
6 Ashams Mathew, "Advanced
Cryptographic Steganography Using Multimedia
Files", Researchgate, India, 2012.
7 D. Eastlake, P. Jones, "US Secure Hash
Algorithm",Cisco Systems, 2001
8 C. Saravanan, "Color Image to
Grayscale Image Conversion", IEEE Xplore Digital Library, 12 April
2010.