ARMY DATA ENCODE USING VISUAL CRYPTOGRAPHY
A Project report submitted in partial fulfillment of the requirements for
the award of the degree of
BACHELOR OF TECHNOLOGY
IN
COMPUTER SCIENCE ENGINEERING
Submitted by
M.V.R. NIKHIL 316126510029
B. NIKHIL 316126510006
K. SAI SANKAR 316126510023
SHIV SHANKAR SINGH 316126510050
D. SAI GANESH PATNAIK 316126510071
Under esteemed guidance of
Mr. G. Jagadish Assistant Professor Dept. of CSE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING ANIL NEERUKONDA INSTITUTE OF TECHNOLOGY & SCIENCES (AUTONOMOUS) (Permanently Affiliated to Andhra University) SANGIVALASA: VISAKHAPATNAM – 531162 2019-2020
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING ANIL NEERUKONDA INSTITUTE OF TECHNOLOGY AND SCIENCES (UGC AUTONOMOUS) (Affiliated to AU, Approved by AICTE and Accredited by NBA & NAAC with ‘A’ Grade) Sangivalasa, Bheemili Mandal, Visakhapatnam dist.(A.P)
CERTIFICATE
This is to certify that the project report entitled “ARMY DATA ENCODE USING VISUAL CRYPTOGRAPHY” submitted by M.V.R. Nikhil(316126510029), B. Nikhil (316126510006), K. Sai Sankar(316126510023), Shiv Shankar Singh(316126510050), D. Sai Ganesh Patnaik(316126510071) in partial fulfilment of the requirements for the award of the degree of Bachelor of Technology in Computer Science Engineering of Anil Neerukonda Institute of technology and sciences (A), Visakhapatnam is a record of bonafide work carried out under my guidance and supervision.
Project Guide Head of the Department
Mr. G. Jagadish, Dr. R. Sivaranjani, Assistant Professor Professor Department of CSE Department of CSE ANITS ANITS
DECLARATION
We, M.V.R. NIKHIL, B. NIKHIL, K. SAI SANKAR, SHIV SHANKAR SINGH, D. SAI GANESH PATNAIK of final semester B.Tech., in the department of Computer Science and Engineering from ANITS, Visakhapatnam, hereby declare that the project work entitled ARMY DATA ENCODE USING VISUAL CRYPTOGRAPHY is carried out by us and submitted in partial fulfillment of the requirements for the award of Bachelor of Technology in Computer Science Engineering , under Anil Neerukonda Institute of Technology & Sciences(A) during the academic year 2016-2020 and has not been submitted to any other university for the award of any kind of degree.
M.V.R.NIKHIL 316126510029 B.NIKHIL 316126510006 K.SAI SANKAR 316126510023 SHIV SHANKAR SINGH 316126510050 D.SAI GANESH PATNAIK 316126510071
ACKNOWLEDGEMENT
We would like to express our deep gratitude to our project guide Mr. G. Jagadish, Assistant Professor, Department of Computer Science and Engineering, ANITS, for his guidance with unsurpassed knowledge and immense encouragement. We are grateful to Dr. R. Sivaranjani, Head of the Department, Computer Science and Engineering, for providing us with the required facilities for the completion of the project work.
We are very much thankful to the Principal and Management, ANITS, Sangivalasa, for their encouragement and cooperation to carry out this work.
We express our thanks to all the teaching faculty of Department of CSE, whose suggestions during reviews helped us in accomplishment of our project. We would like to thank all non-teaching staff of the Department of CSE, ANITS for providing great assistance in accomplishment of our project.
We also thank our project coordinator Dr. K. Suresh, Assistant Professor, Department of Computer Science and Engineering, ANITS, for his constant support throughout our project period.
We would like to thank our parents, friends, and classmates for their encouragement throughout our project period. At last but not the least, we thank everyone for supporting us directly or indirectly in completing this project successfully.
PROJECT STUDENTS
M.V.R. NIKHIL (316126510029) B. NIKHIL (316126510006) K.SAI SANKAR (316126510023)
SHIV SHANKAR SINGH (316126510050) D.SAI GANESH PATNAIK (316126510071)
ABSTRACT
In any army a decision is not directly taken by just one commander or leader but rather that same decision is taken only after discussing about that issue and a majority agrees upon it. This had become the base idea of our project.
In this project, the idea was to secretly transmit a secret image which can possible be any kind of important map or as such to the main people in the army and the original image can be formed only when the required number of people agree to that plan. This is done by the concept called “Visual Cryptography”. Visual Cryptography deals with images.
Visual cryptography is a technique which allows visual information such as images, videos etc. to be encrypted in such a way that the decrypted information appears as a visual image .In this project we implement visual cryptography on black and white images and color images(RGB) using “(k , n) secret image sharing algorithm” .This scheme is perfectly secure and very easy to implement. We extend this algorithm in such a way that the secret image is divided into n shares and each share is sent to n different officers and only when at least k officers (k ≤ n) agree to see the secret and when they combine their individual share, the secret is revealed.
Keywords cryptography, decryption, encryption, k out of n shares, (k, n) secret sharing algorithm, OR, RSA, shares, visual cryptography.
i
TABLE OF CONTENTS
ABSTRACT i
List of Figures v
List of Tables vii
1. INTRODUCTION 1
1.1 Digital Image Processing 1
1.1.1 Steps in Image Processing 1
1.1.2 What is an Image? 1
1.1.3 Representation of an image in a Matrix 2
1.1.4 Types of Images 2
1.2 Visual Cryptography 3
1.2.1 Cryptography 3
1.2.2 Visual Cryptography 3
1.3 Motivation for the work 4
1.4 Problem Statement 6
2. LITERATURE SURVEY 7
2.1 Binary Image 8
2.2 Quantization and Thresholding 10
2.3 Halftoning 11
2.4 Dithering 13
2.5 Human Visual System 15
ii
2.6 Shamir’s Secret Sharing Scheme 16
2.7 Secret Sharing Scheme Using Lagrange’s Interpolation Theorem 16
2.8 Two-out-of-two Secret Sharing Scheme 17
2.9 K-N Secret Sharing Scheme 19
2.10 Existing System 20
3.METHODOLOGY 22
3.1 Proposed System 23
3.1.1 System Architecture 23
3.1.2 Modules 25
3.1.2.1 Encryption 25
3.1.2.2 Division Into ‘n’ Shares 28
3.1.2.3 Generate and Send e-mails to each Shareholder 31
3.1.2.4 Overlapping ‘k’ Shares 31
3.1.2.5 Decryption 34
4.EXPERIMENTAL ANALYSIS AND RESULTS 37 4.1. System Configurations 37 4.1.1 Software Configurations 37 4.1.2 Hardware Configurations 37 4.2 Sample Code 38 4.3 Screenshots and Outputs 49 4.4 Experimental Analysis 59
iii
5.CONCLUSION AND FUTURE WORKS 62
5.1 Conclusion 62
5.2 Future Works 62
REFERENCES 64
APPENDIX 65
iv
LIST OF FIGURES
FIGURE FIGURE DESCRIPTION PAGE NO. NO. Fig(2.a) Bitmap Representation 9 Fig(2.b) Quantization levels for 8-bit representation of an Image 10 Fig(2.c) Original Image and its Threshold Image 11 Fig(2.d) Original Halftone Image v/s how a Human Eye sees a Halftoned 12 Image Fig(2.e) Original Image and Halftoned Image 13 Fig(2.f) Original Image, Image with Uniform Quantization and Dithering 14 Fig(2.g) Human Visual System as OR function 15 Fig(2.h) Construction of a two-out-of-two VC scheme: a secret pixel can be 18 encoded into two subpixels in each of the two shares. Fig(2.i) An example of two-out-of-two VC scheme. 19 Fig(3.a) System Architecture 23 Fig(3.b) Encryption and Division into ‘n’ shares 28 Fig(3.c) Merging at least ‘k’ shares and Decryption 33 Fig(3.d) Order of Encryption and Decryption 34 Fig(4.a) Home Page 49 Fig(4.b) Encryption and Dividing into ‘n’ Shares Page 50 Fig(4.c) Page after encryption and dividing into ‘n’ shares: also shows 50 which share is sent to which e-mail address. Fig(4.d) Merging ‘k’ Shares and Decryption Page 51 Fig(4.e) Output Page (when there are at least required number of ‘k’ shares 51 and keys of both RSA and Caesar Cipher are correct). Fig(4.f) Output Page (when there are at least required number of ‘k’ shares 52 and key RSA is wrong and key of Caesar Cipher is correct). Fig(4.g) Output Page (when there are at least required number of ‘k’ shares 52 and key RSA is correct and key of Caesar Cipher is wrong). Fig(4.h) Output Page (when there are less than required number of ‘k’ shares 53 and keys of both RSA and Caesar Cipher are correct or wrong). Fig(4.i) Data Set that is worked on 53 Fig(4.j) Original Input Image 54 Fig(4.k) Encrypted Image(key in CC: god 54 Key in RSA: p=89,q=97,e=5,d=5069,n=8633) Fig(4.l) ‘n’ Shares of the Input Image 55 (n=5, k=4) Fig(4.m) Image obtained after merging at least ‘k’ shares (here 4 shares are 56 taken) Fig(4.n) Image obtained after merging less than ‘k’ shares (here 3 shares are 56 taken) and before decrypting
v
Fig(4.o) Output Image obtained when both the keys are correct 57 Fig(4.p) Output Image obtained when only the decryption key used in 57 Caesar Cipher is Wrong Fig(4.q) Output Image obtained when only the decryption key used in RSA 58 is Wrong. Fig(4.r) Output Image obtained when less than ‘k’ shares are combined. 58 Fig(app1) Structure of Django 67
vi
LIST OF TABLES
TABLE TABLE DECRIPTION PAGE NO. NO. Table 4.a RSA Encryption and Decryption times for images with different 59 resolutions Table 4.b Caesar Cipher Encryption and Decryption times for images with 60 different resolutions. Table 4.c Time taken for Dividing an Image into ‘n’ shares and Combining 60 ‘k’ shares to form an Image for images with different resolutions (n=5, k=4).
vii
1. INTRODUCTION
1.1 DIGITAL IMAGE PROCESSING
Digital Image Processing means processing digital image by means of a digital computer. We can also say that it is a use of computer algorithms, in order to get enhanced image either to extract some useful information.
1.1.1 Image processing mainly include the following steps:
1. Importing the image via image acquisition tools; 2. Analysing and manipulating the image; 3. Output in which result can be altered image or a report which is based on analysing that image.
1.1.2 What is an Image?
An image is defined as a two-dimensional function, F(x, y), where x and y are spatial coordinates, and the amplitude of ‘F’ at any pair of coordinates (x, y) is called the intensity of that image at that point. When x, y, and amplitude values of ‘F’ are finite, we call it a digital image.
In other words, an image can be defined by a two-dimensional array specifically arranged in rows and columns.
Digital Image is composed of a finite number of elements, each of which elements have a particular value at a particular location. These elements are referred to as picture elements, image elements, and pixels. A Pixel is most widely used to denote the elements of a Digital Image.
1
1.1.3 Representation of an Image in a Matrix
As we know, images are represented in rows and columns we have the following syntax in which images are represented:
The right side of this equation is digital image by definition. Every element of this matrix is called image element, picture element, or pixel.
1.1.4 Types of Images
1. BINARY IMAGE– The binary image as its name suggests, contain only two pixel elements i.e. 0 & 1, where 0 refers to black and 1 refers to white. This image is also known as Monochrome.
2. BLACK AND WHITE IMAGE– The image which consist of only black and white colour is called BLACK AND WHITE IMAGE.
3. 8 bit COLOUR FORMAT– It is the most famous image format. It has 256 different shades of colours in it and commonly known as Grayscale Image. In this format, 0 stands for Black, and 255 stands for white, and 127 stands for grey.
2
4. 16 bit COLOUR FORMAT– It is a colour image format. It has 65,536 different colours in it. It is also known as High Colour Format. In this format the distribution of colour is not as same as Grayscale image. A 16 bit format is actually divided into three further formats which are Red, Green and Blue which is the famous RGB format.
1.2 VISUAL CRYPTOGRAPHY
1.2.1 Cryptography
The word cryptography is derived from two Greek words which mean “secret writing”. Cryptography is the process of scrambling the original text by rearranging and substituting the original text, arranging it in a seemingly unreadable format for others.
Cryptography is an effective way to protect the information that is transmitting through the network communication path.
1.2.2 Visual Cryptography
Visual cryptography is a cryptographic technique which allows visual information (pictures, text, etc.) to be encrypted in such a way that decryption can be done just by sight reading. Visual cryptography, degree associated rising cryptography technology, uses the characteristics of human vision to rewrite encrypted photos. Visual cryptography provides secured digital transmission that is used just for merely the once.
Numerous guidance like military maps and business identifications are transmitted over the internet. Whereas pattern secret photos, security problems ought to be compelled to be taken into thought as a result of hackers may utilize weak link over the communication network to steal info that they need. To touch upon the protection problems with secret photos, varied image secret sharing
3
schemes are developed. anyone will use it for coding with none science information and any computations.
Visual Cryptography is one variant of Image Processing where we hide the secret image so that it is not visible as it has to be but is seen as a different image. Visual cryptography is the method of hiding images or documents by shadowing the original image into specific shares which are visually not recoverable. These shares when superimposed on one another would give away the concealed image which can be visually decrypted without further computation.
A secret is something which is kept from the knowledge of any but the initiated or privileged. Secret sharing denies a method by which a secret can be distributed between a group of participants, whereby each participant is allocated a piece of the secret. This piece of the secret is known as a share. The secret image can only be reconstructed when a sufficient number of shares are combined together. While these shares are separated, no information about the secret can be accessed. That is, the shares are completely useless while they are separated. These shares when superimposed on one another would give away the concealed image.
1.3 MOTIVATION FOR THE WORK
Numerous guidance like military maps and business identifications are transmitted over the internet. Whereas pattern secret photos, security problems ought to be compelled to be taken into thought as a result of hackers may utilize weak link over the communication network to steal info that they need. To touch upon the protection problems with secret photos, varied image secret sharing schemes are developed. anyone will use it for coding with none science information and any computations.
This very idea of sensitive data being tapped by the hackers motivated us to think of this project. Army maps are generally one of the most sensitive information to be retrieved by the hackers and if that happens, it might result in a disaster for that country.
4
This can happen when this stolen information goes into the wrong hands like terrorists. Now terrorists will have the information about the army plans that are being executed.
To prevent this from happening the map or any information related to the army is divided into a number of shares each of which bears some information but only when a minimum number of shares are put together. Individually, those shares are useless even if they are stolen and do not give away any important information. Only when a minimum number of shares are brought together the information is again reconstructed.
In any army, decisions are only taken when a number of people (higher officials) agree upon a particular idea. This is the main idea of this project. The information (image) is divided into ‘n’ number of shares and the original information can only be reconstructed or formed only when ‘k’ number of people agree on that idea (where k<=n) and combine them. Even if ‘k-1’ people agree to that idea and combine their shares, the original information cannot be retrieved back. This is the main motivation behind this project.
5
1.4 PROBLEM STATEMENT
Let ‘D’ be the secret image to be shared among ‘n’ parties. A (k, n)-threshold scheme is a way to divide,
‘D’ into ‘n’ pieces D1, . . . , Dn that satisfies the following conditions:
1. Knowledge of any ‘k’ or more Di pieces makes ‘D’ easily computable,
2. Knowledge of any ‘k -1’ or fewer Di pieces leaves ‘D’ completely undetermined (in the sense that all its possible values are equally likely).
We are using above algorithm for military purpose. We can use this process to share a confidential image data over a channel to different defense cadet.
Suppose we have to send a very highly confidential map image data to army officers deployed near battle field. We can split the image into ‘n’ shares and makes it compulsory for at least ‘k’ images to be merged to get the original image back. By doing so we can send ‘n’ shares of a secret image to ‘n’ army officers. They can only access this map image (secret image) only if at least ‘k’ officers agree on the orders given by the department.
Suppose out of ‘n’ officers ‘(k-1)’ are spies. Even if they have their share of image, they cannot recover the original image. There have to be at least ‘k’ images to get back the original image. By doing so we can provide a high level of security.
We also maintain a secret key value to provide extra security that will encrypt the original image. So, now to get the original image we not only we need ‘k’ image shares but also the key to decrypt it. Now it becomes very difficult to access the image by an unauthorized person.
6
2. LITERATURE SURVEY
Visual cryptography is a cryptographic technique which allows visual information to be encrypted in specific a way that decryption becomes a mechanical operation that does not require a computer. The idea was about producing image shares of a given secret image in a way that the image shares appear meaningless. Recovery of the image can be done by superimposing specified number of share images and, hence, the decoding process requires no special hardware or software and can be simply done by the human eye. Visual cryptography is a little more advantageous for implementation, while compared to conventional cryptography schemes, since the decryption process does not need any computation. Further, the image-based information becomes more secure, since only the intended recipient can reveal the true meaning of the decrypted image. Suppose the data (image) D is divided into n shares. D can be constructed from any k shares out of n shares. Complete knowledge of (k-1) shares reveals no information about D. So, k out of n shares is necessary to reveal secret data.
Visual cryptography technique was introduced by Naor and Shamir in 1994 as an alternative for conventional cryptography. They demonstrated a visual secret sharing plan, where a picture was separated into n imparts so that just somebody to all n shares could decode the picture, while any n-1 shares uncovered no data about the first original image. Each share was printed on a separate transparency, and decryption was performed by overlaying the shares. At the point when all n shares were overlaid, the first picture would show up. There are a few speculations of the fundamental plan including k-out-of-n visual cryptography. Rijimen displayed another 2-out-of-2 VC plot by applying the thought of shading mixture. When two transparencies superimposed on one another with distinctive colours, they lead to raises a third blended shading. In 2002, Nakajima predicted a new method of extended visual cryptography. This method is for regular images which are used to produce meaningful binary shares. This system works by taking three pictures as an input and generates two images which correspond to two of the three input pictures. The third picture is recreated by printing the two share pictures onto transparencies and stacking them together. By and large, visual
7 cryptography experiences the deterioration of the image quality. In this also describes the method to improve the quality of the output image. Binary visual cryptography scheme is proposed Hou et al. in the year 2004, which is applied to grey level images, that a grey level image is transformed into halftone images. The method that uses the density of the net dots to simulate the grey level is called Halftone and transforms an image with grey level into a binary image before processing. Halftone visual cryptography is proposed by the Zhi Zhou et al. In 2006 which produce meaningful and good high-quality halftone shares, the generated halftone shares contain the visual information. The basic idea of secret sharing was introduced by Shamir in the year 1994 in his paper “How to Share a Secret?” where a data D is divided into ‘n’ shares/pieces in such a way that ‘D’ can be easily reconstructed from any of the ‘k’ out of those ‘n’ shares/pieces, but the knowledge of at most ‘k-1’ pieces cannot reconstruct ‘D’. This was implemented by the concept of ‘Interpolation’. This idea was further developed into K-N Secret Sharing algorithm by using a Random Number where in each pixel value is being put in any of the ‘n-k+1 shares’(reconstruction factor) out of the ‘n’ shares so that a particular pixel value is definitely found in at least one of the ‘k’ shares that are being selected. We also made use of the paper “A Novel Approach on Secure Data Transfer for General Transactions using Secret Sharing Scheme”.
In addition to the above-mentioned algorithm, we introduced a cryptographic technique to encrypt the secret image and then divide it into ‘n’ shares. Later after combining ‘k’ shares we then need to decrypt the reconstructed image to get back the secret image. Here, in this project we used a simple symmetric cryptographic algorithm (Caesar Cipher) along with a strong asymmetric cryptographic algorithm (RSA) to provide more security.
2.1 BINARY IMAGE A binary image is a digital image that has only two possible values for each pixel. Typically, the two colours used for a binary image are black and white. The colour used for the object(s) in the image is the foreground colour while the rest of the image is the
8 background colour. In the document-scanning industry, this is often referred to as "bi- tonal". Binary images are also called bi-level or two-level. This means that each pixel is stored as a single bit—i.e., a 0 or 1. The names black-and-white, B&W, monochrome or monochromatic are often used for this concept, but may also designate any images that have only one sample per pixel, such as grayscale images. In Photoshop parlance, a binary image is the same as an image in "Bitmap" mode. Binary images often arise in digital image processing as masks or as the result of certain operations such as segmentation thresholding, and dithering Some input/output devices, such as laser printers fax machines and bilevel computer displays, can only handle bilevel images. A binary image can be stored in memory as a bitmap a packed array of bits. A 640×480 image requires 37.5 KiB of storage. Because of the small size of the image files, fax machine and document management solutions usually use this format. Most binary images also compress well with simple run-length compression schemes. Binary images can be interpreted as subsets of the two-dimensional integer lattice Z2; the field of morphological image processing was largely inspired by this view.
Fig 2.a Bitmap Representation
Allowing only one bit per pixel you can create two colours, black and white. These colours will be represented by the binary equivalent. So, for the colour white, the binary representation would be ’00’. And for Black the binary representation would be ’01’.
9
2.2 QUANTIZATION AND THRESHOLDING Quantization is the process of converting a continuous range of values into a finite range of discreet values. As number of bits to represent a pixel intensity (assume Gray scale image for convenience) is limited, quantization is needed. Suppose 8 bit is used for a pixel, it’s equivalent value ranges from 0 to 255 (discrete values). 0 is assigned to pure Black, and 255 is assigned to pure White. Intermediate values are assigned to grey scales as shown in this image. This process is quantization. For 8 bit pixels, quantization level is 256.
Fig 2.b Quantization levels for 8-bit representation of an Image
Image thresholding is a simple, yet effective, way of partitioning an image into a foreground and background. This image analysis technique is a type of image segmentation that isolates objects by converting grayscale images into binary images. Image thresholding is most effective in images with high levels of contrast.
10
Fig 2.c Original Image and its Threshold Image
To improve the threshold image and make it look much clearer, these techniques can be used 1. Halftoning 2. Dithering
2.3 HALFTONING Halftone is the reprographic technique that simulates continuous-tone imagery through the use of dots, varying either in size or in spacing, thus generating a gradient-like effect. "Halftone" can also be used to refer specifically to the image that is produced by this process. Where continuous-tone imagery contains an infinite range of colours or greys, the halftone process reduces visual reproductions to an image that is printed with only one colour of ink, in dots of differing size (pulse-width modulation) or spacing (frequency modulation) or both. This reproduction relies on a basic optical illusion when the halftone dots are small, the human eye interprets the patterned areas as if they were smooth tones. At a microscopic level, developed black-and-white photographic film also consists of only two colours, and not an infinite range of continuous tones. For details, see Film grain
11
Just as colour photography evolved with the addition of filters and film layers, colour printing is made possible by repeating the halftone process for each subtractive colour – most commonly using what is called the "CMYK colour model” The semi-opaque property of ink allows halftone dots of different colours to create another optical effect, full-colour imagery.
Fig 2.d Original Halftone Image v/s how a Human Eye sees a Halftoned Image
12
Fig 2.e Original Image and Halftoned Image 2.4 DITHERING Dithering is used in computer graphics to create the illusion of "color depth" in images with a limited color palette - a technique also known as color quantization. In a dithered image, colors that are not available in the palette are approximated by a diffusion of colored pixels from within the available palette. The human eye perceives the diffusion as a mixture of the colors within it. Dithered images, particularly those with relatively few colors, can often be distinguished by a characteristic graininess or speckled appearance.
By its nature, dithering introduces pattern into an image - the theory being that the image will be viewed from such a distance that the pattern is not discernible to the human eye. Unfortunately, this is not always the case, and often the patterning is visible - for example, with some images found on the web. In these circumstances it has been shown that a blue-noise dither pattern is the least unsightly and distracting. The error diffusion techniques were some of the first methods to generate blue-noise dithering patterns. However, other techniques such as ordered dithering can also generate blue-noise dithering without the tendency to degenerate into areas with artifacts.
13
Fig 2.f Original Image, Image with Uniform Quantization and Dithering
14
2.5 HUMAN VISUAL SYSTEM
Fig 2.g Human Visual System as OR function
Human visual system acts as an OR function. If two transparent objects are stacked together, the final stack of objects will be transparent. But if any of them is non- transparent, then the final stack of objects will be nontransparent. Like OR, 0 OR 0 = 0, considering 0 as transparent and 1 OR 0=1, 0 OR 1 =1, 1 OR 1=1, considering 1 as non- transparent.
15
2.6 SHAMIR’S SECRET SHARING SCHEME
Shamir’s Secret Sharing algorithm is an old cryptography algorithm (1979) invented by the Israeli cryptographer Adi Shamir (co-inventor of RSA) for sharing a secret across multiple parties
More particularly Shamir Secret Sharing Scheme (SSSS) enables to split a secret S in n parts such that with any k-out-of-n pieces you can reconstruct the original secret S, but with any k-1 pieces no information is exposed about S. That is conventionally called a (n, k) threshold scheme.
At first this may seem counterproductive in the context of secure data transmission because if there is a secure way of distributing a secret S amongst participants what is the point of using this scheme. The original purpose of the scheme is to enhance practicality and convenience when multiple parties are required to perform an authorized action.
2.7 SECRET SHARING SCHEME USING LAGRANGE’S INTERPOLATION THEOREM
Any method of dividing a secret into multiple (that is “n“) participants is secret sharing. Each person receives a piece of the secret and the secret can be recovered by combining some or all of the shares. The secret is in the form of polynomial of degree “t- 1”, where “t “is the number of keys needed to get the secret (i.e., threshold value). The polynomial is expressed mathematically as follows.