Simple Encryption and Decryption using C#.
Implemention of DESCryptoServiceProvider
Using the code
Encryption is used to convert the text into non-meaning full text. Dot Net provides different algorithms to encrypt text. Varies (64bit,128bit,256bit and 512bit). in this article i used 64bit (8 byte) encryption by using
DESCryptoServiceProvider des = new DESCryptoServiceProvider();
DESCryptoServiceProvider requires Key and initialization Vector (IV) both (8 byte) to encrypt text and decrypt it back. This class provides access to the Windows CryptoAPI cryptography services.
It can be used to encrypt text in different scenarios. For example you can encrypt the text you want to use as query string in web applications. because it is clearly visible to user. for security purposes we can encrypt the id's used in query strings.
It can be used to encrypt text in different scenarios. For example you can encrypt the text you want to use as query string in web applications. because it is clearly visible to user. for security purposes we can encrypt the id's used in query strings.
For example the URL
http://localhost/Employee/Salary?EmployeeID=767877686
can be converted to
http://localhost/Employee/Salary?EmployeeID=LhuJsI79G5E4DNnN2GxdqQ==
http://localhost/Employee/Salary?EmployeeID=767877686
can be converted to
http://localhost/Employee/Salary?EmployeeID=LhuJsI79G5E4DNnN2GxdqQ==
The EmployeeID=767877686 is Equal to LhuJsI79G5E4DNnN2GxdqQ==
Implemention of DESCryptoServiceProvider
Add the following class to your project
1 | using System; |
1 | private void btnEncrypt_Click(object sender, EventArgs e) |
5 Comments
how to decrypt it using php ?
ReplyDeleteHow to decode generated string in android studio?
ReplyDeletehow decrypt this url
ReplyDeletei want id ...
https://sbs.beinsports.net/MP/MP/Renew/yIGqmFMj7XG%20VIGchB4qB4GYulF618SdoLiTG4R8WN6mdSG18W8SbWqz37bHeBxd7KT8kdQnglLDHVL6x5b_BFhzoTQAsnWXbgL46H913B2PDgddZwUSx6EYti824Zr6i4ljS3nZSiEgZyGdPxwXUtcySEb9RWVvJyPFPuM0hK%20m5G_jNKE1Yg%3d%3d
how decrypt this url
ReplyDeletei want id ...
https://sbs.beinsports.net/MP/MP/Renew/yIGqmFMj7XG%20VIGchB4qB4GYulF618SdoLiTG4R8WN6mdSG18W8SbWqz37bHeBxd7KT8kdQnglLDHVL6x5b_BFhzoTQAsnWXbgL46H913B2PDgddZwUSx6EYti824Zr6i4ljS3nZSiEgZyGdPxwXUtcySEb9RWVvJyPFPuM0hK%20m5G_jNKE1Yg%3d%3d
Dosen't work, can't decrypt.
ReplyDeletePost a Comment