Posts

Showing posts from July, 2014

RSA encryption algorithm and it's methematical background and it's application in php

Image
          Mathematics Behind RSA Encryption Algorithm  rsa cryptography uses properties of   humongous numbers as large power of bigger numbers we can't calculate this mathematics directly when numbers are so huge. so here we use tricky mathematics called Modular Airthmathics. we uses Modular Airthmathic because we we don't have to work with large numbers in Modular Airthmatic.      For example: 5  module  3 is 2 because: 5 = 1 * 3 + 2. example: 40mod10=30mod10=0. because:40=4*10+0.              30=3*10+0. Modular multiplication of many numbers- X = 36 * 53 * 91 * 17 * 22 (mod 29) . now 36(mod29)=7.       53(mod29)=24.        91(mod29)=4.        17(mod29)=17.        22(mod29)=22. hence X=7*24*4*17*22(mod29).          X=14. Modular Powers- compute 11 43 ...

vegerne cipher decryption and its application in php

         vegerne cipher encryption and its application in php              now i will make a function in php that will do this job for you.              lets have a look on that function     //function for vegerne cipher decryption function vegerne_decipher($str,$str_passwd) { if(preg_match("/[^a-zA-Z]/", $str_passwd)) { return null; } else { $str_password=strtolower($str_passwd); $pass_arr=array(); $pass_arr_num=array(); $alpha=array('a'=>'1','b'=>'2','c'=>'3','d'=>'4','e'=>'5','f'=>'6','g'=>'7','h'=>'8','i'=>'9','j'=>'10','k'=>'11','l'=>'12','m'=>'13','n'=>'14','o'=>'15','p'=>'16','q'=>'17','r'=>'18...

ciphers continued--Vegerne Cipher and its application in php

Image
> 2.Vegerne Cipher- The Vigenère cipher is a method of encrypting alphabetic text by using a series of different Caesar ciphers based on the letters of a keyword. It is a simple form of polyalphabetic substitution. The Vigenère cipher has been reinvented many times. lets look at the image for vegerne ciphers  logic now i will make a function for encription by logic of vegerne cipher function vegerne_cipher($str,$str_passwd) { if(preg_match("/[^a-zA-Z]/", $str_passwd)) { return null; } else { $str_password=strtolower($str_passwd); $pass_arr=array(); $pass_arr_num=array(); $alpha=array('a'=>'1','b'=>'2','c'=>'3','d'=>'4','e'=>'5','f'=>'6','g'=>'7','h'=>'8','i'=>'9','j'=>'10','k'=>'11','l'=>'12','m'=...

Ancient Cryptography-ciphars

Image
                            Ancient cryptography-ciphars                 1. caesar ciphars -In cryptography caesar ciphar are also known as shift ciphers, caesar's ciphar etc.. this technique of encryption is thousands of years old.In this technique we shift a character with shift value, suppose we have a character class[a-z](means a to z characters) that is situated from 0 to 25. now with a shift value i shift a position of character.like i have a message 'hs' . with shift 5. this message will become 'mx'. thus we encrypt a message by caesar ciphars. this is very weak technique of encryption. because there is 25 values that you can give to shift.  although  you do not know the value of shift, you can break the encryptoin by knowing the occurance frequencies of particular characters.      alogrithm seen in picture is used by ca...