CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of encrypt
Encrypting appSettings and connectionStrings sections in web.config :
 
   aspnet_regiis.exe –pef "appSettings" "<Path.to.website.directory>"
 
   aspnet_regiis.exe –pef "connectionStrings" "<Path.to.website.directory>"
 
-----
 
Encrypting appSettings and connectionStrings sections in web.config and specifying the Data Protection Provider:
by NEParis   January 04, 2012 @ 9:33am
24 Views
no comments
 
C#
/// <summary>
  /// Encrypts the conn string.   
  /// </summary>
  /// <remarks></remarks>
  public void EncryptConnString()
  {
 
      Configuration config = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
      ConfigurationSection section = config.GetSection("connectionStrings");
      if (!section.SectionInformation.IsProtected)
by Gary Cline   September 22, 2010 @ 3:01pm
184 Views
no comments
 
To Encrypt, run the following from the Visual Studio command prompt:
 
  aspnet_regiis -pe "connectionStrings" -app "/AppName" -prov "RsaProtectedConfigurationProvider"
 
To Decrypt, run the following from the Visual Studio command prompt:
 
  aspnet_regiis -pd "connectionStrings" -app "/AppName"
 
by Al Gonzalez   July 12, 2010 @ 4:39pm
256 Views
no comments
 
C#
using System;
using System.Security.Cryptography;
 
namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string PlainText = "Luciano Evaristo Guerche";
248 Views
no comments
 
C#
        /// <summary>
        /// Encrypts a string at the current user's scope using DPAPI.
        /// </summary>
        /// <param name="toEncrypt">The string to encrypt.</param>
        /// <param name="key">The key used to encrypt it.</param>
        /// <returns>
        /// The encrypted bytes that only the current user, with the specified key,
        /// can decrypt again.
        /// </returns>
        /// <seealso cref="CR_CodeTweet.ByteExtensions.Decrypt" />
by Mehul Harry   December 15, 2009 @ 4:07pm
316 Views
no comments
 
C#
namespace SignAndEncryptXmlDocumentConsoleApplication
{
    using System;
    using System.IO;
    using System.Security.Cryptography;
    using System.Security.Cryptography.Xml;
    using System.Xml;
 
    class Program
    {
599 Views
no comments
 
C#
using System;
using System.Security.Cryptography;
using System.Text;
using System.Web;
 
public static string HashedString(string cleanString, string salt)
{
    if (String.IsNullOrEmpty(cleanString)) { return String.Empty; }
 
    //Bytes to hash
by tomy ismail   July 15, 2009 @ 10:32pm
253 Views
no comments
 
C#
using System.Security.Cryptography;
using System.Text;
using System.Web;
 
public static string SHA256Encrypt(string source, int digitRandom)
{
    string outputHash = String.Empty;
 
    try
    {
by tomy ismail   July 15, 2009 @ 10:29pm
291 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate