- database.zip
- Database
- MS Access
- AccountPlus.mdb
- MySQL
- SQL Server
- Backup
- AccountPlus.bak
- Script
- accountplussource.zip
- AccountPlusSource
- AccountPlus.BusinessLogic
- AccountPlus.Configurations
- AccountPlus.DataAccess
- AccountPlus.Formatting
- AccountPlus.Messaging
- AccountPlus.Setup
- AccountPlus.sln
- AccountPlus.UserInterface
- Assemblies
- log4net.dll
- setup.zip
- Setup
- Setup.msi
- accountplus.zip
- AccountPlus
- AccountPlus
- Source_Code.zip
|
using System;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;
using System.IO;
namespace AccountPlus.BusinessLogic
{
/// <summary>
/// Class to be used for providing security to sensitive data by Encryption/ Decryption
/// </summary>
public class DataSecurity
{
static byte[] bytes = ASCIIEncoding.ASCII.GetBytes("ZeroCool");
/// <summary>
/// Encrypt normal string.
/// </summary>
/// <param name="originalString">String to be encrypted.</param>
/// <returns>Encrypted string</returns>
public string Encrypt(string originalString)
{
if (String.IsNullOrEmpty(originalString))
return string.Empty;
DESCryptoServiceProvider cryptoProvider = new DESCryptoServiceProvider();
MemoryStream memoryStream = new MemoryStream();
CryptoStream cryptoStream = new CryptoStream(memoryStream,
cryptoProvider.CreateEncryptor(bytes, bytes), CryptoStreamMode.Write);
StreamWriter writer = new StreamWriter(cryptoStream);
writer.Write(originalString);
writer.Flush();
cryptoStream.FlushFinalBlock();
writer.Flush();
return Convert.ToBase64String(memoryStream.GetBuffer(), 0, (int)memoryStream.Length);
}
/// <summary>
/// Decrypt encrypted string to the normal string
/// </summary>
/// <param name="cryptedString">Decrypted string</param>
/// <returns>Normal (Decrypted) string</returns>
public string Decrypt(string cryptedString)
{
if (String.IsNullOrEmpty(cryptedString))
{
throw new ArgumentNullException
("The string which needs to be decrypted can not be null.");
}
DESCryptoServiceProvider cryptoProvider = new DESCryptoServiceProvider();
MemoryStream memoryStream = new MemoryStream
(Convert.FromBase64String(cryptedString));
CryptoStream cryptoStream = new CryptoStream(memoryStream,
cryptoProvider.CreateDecryptor(bytes, bytes), CryptoStreamMode.Read);
StreamReader reader = new StreamReader(cryptoStream);
return reader.ReadToEnd();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
• 8 years of experience in IT Industry as a Developer.
• Experience of End-To-End Software Development and Implementation (Entire SDLC i.e Software Development Life Cycle)
• Real time Exposure to Banking, Finance and Energy industry.
• Expertise in distributed application architecture as well as web based applications using Microsoft.NET platform.
• Expertise in database design, SQL programming and SQL performance tuning.
• Expertise in Web Services and WCF Services.
• Experience of Rich Internet Application using Adobe Flex.
• Experience in migration of legacy application to latest technology, migration of VB application to .NET.
• Knowledge of OOPS and Design Concepts.
• Expertise in Agile/ Scrum software development processes.
Specialties
• Languages\ Technologies-
.NET Framework 1.1/2.0/3.0/3.5, C#.NET, VB.NET, ASP.NET, VB6, AJAX, ASP.NET, Adobe Flex 3.0, Web Services, Windows Communication Foundation (WCF), LINQ, SQL Server, Oracle, MySql, MS Access, HTML, XML, JavaScript, C# Script, CSS and XSLT.
• Methodology/ Concepts-
OOPS, Data Structures, Design Concepts and Agile/ Scrum Software Development