In cryptography, we must know about Encryption and Decryption
Encryption is system algorithm that used to change some of plain-text (for example) into some unreadable text or unusual character that just can possessing by knowledge. the algorithm is usually called as chiper here. First, this encryption used by military to make enemy confuse when they send to another base to make some move plan. but, for now most company using this way to make their database keep safe. so, if someone who restrict come and have the data, that will cannot be read until they and just be the meaningless text.
Decryption is the other side of encryption that used the related algorithm to decode the encrypted text be an normal text or human readable. but, you cannot make a decryption system without knowing what is algorithm that encryption used before. why, the logic is like this, you will not recognize some people language without knowing where they from. it's make sense right? that's why, most of other people who do this job is always make an encryption first before decryption. hehehe
Example for Encryption
Using the code
The main code used for the conversion is from the Microsoft.VisualBasic class. Below is the code that is used to convert a string to hexadecimal format. We can't direct convert all characters in to hexadecimal format (eg:@#$%^&*()) that's why firstly I take ASCII value of the character, and then convert ASCII value into hexadecimal format.
//For this I made while loop
while (Data.Length > 0)
{
//first I take each character using substring
sValue= Data.Substring(0, 1).ToString()
//then convert character into ascii.
sValue= Strings.Asc(sValue)
//then convert ascii value into Hex Format
sValue = Conversion.Hex(sValue)
//after converting remove the character.
Data = Data.Substring(1, Data.Length - 1);
sHex = sHex + sValue;
}
Ony two functions I used for this application
public string PasswordDecription(ref string Data)
{
string Data1 = "";
string sData = "";
while (Data.Length > 0)
{
Data1 = System.Convert.ToChar(System.Convert.ToUInt32(Data.Substring(0, 2), 16)).ToString();
sData = sData + Data1;
Data = Data.Substring(2, Data.Length - 2);
}
return sData;
}
public string PasswordEncription(ref string Data)
{
string sValue;
string sHex = "";
while (Data.Length > 0)
{
sValue = Conversion.Hex(Strings.Asc(Data.Substring(0, 1).ToString()));
Data = Data.Substring(1, Data.Length - 1);
sHex = sHex + sValue;
}
return sHex;
}
the result is you just make the character move down 2 step. okay, that how encryption and decryption work. but this is to easy, the kind of encryption is much more much difficult. maybe next time i will share to you how to make MD5 encryption. How we can read it ..
Cryptography
Stay fun Learning
Regards
Apeh1706
Apeh1706

Tidak ada komentar:
Posting Komentar