asp.net encryption/decryption

Posted on 2012-03-22
Medium Priority
Last Modified: 2012-08-14
I have attached sample codes from my developer. It is a encryption.cs file that created by our previous developer. Now, my task is to call the encryption and decryption function and write the codes on test.aspx/test.cs file.

In this case, can you show me to call  the function on test.cs? I am new in asp.net/c# development. I do have rich experience in java side.

Question by:Webboy2008
LVL 20

Accepted Solution

BuggyCoder earned 2000 total points
ID: 37754495
This is how the code should be called:-

            string enc1 = Encryption.Encrypt("MyTest");
            string enc2 = Encryption.Encrypt("MyTest1", "1234");
            string dec1 = Encryption.Decrypt(enc1);
            string dec2 = Encryption.Decrypt(enc2, "1234");

Open in new window


Author Comment

ID: 37754560
Thank. But I would like to put something like

public string Encryption()
return (data already encrypted);

public string Decryption()
return (data already encrypted)
public Page_Load()
Response.write Encryption("1111-1111-111-1111") //Credit card Sample No.

Can you show me how it works in c#?


Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
If you are looking for an automated solution for backup single or multiple Office 365 user mailboxes to Outlook data file, then you can use Kernel Office 365 Backup & Restore tool. Go through the video to check out the steps to backup single or mult…
Watch the video of Kernel Migrator for SharePoint, which demonstrate the process easily of migration from SharePoint to SharePoint, OneDrive for Business & Google Drive servers, Public Folder to SharePoint, File Server to SharePoint. The tool has va…

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question