EasyByte Software

Welcome to EasyByte Software

Home Buy Online Products Downloads Support
Sections
Index
About
Installation
Properties
Methods
ASP and dotNET
Further Information
  

 

 

ASP, ASP.NET and Cryptocx
 
     

Cryptocx v7 User Guide

 

Using Cryptocx v7 in .Net  and ASP 

Our controls are optimised for use on a Windows 2000, 2003 or 2008 Server when used in ASP or ASP.NET. This is some sample ASP code for using Cryptocx in ASP to encrypt a string using the Blowfish method. The encrypted text is then inserted into the web page for viewing by the user.

You can modify the below code to encrypt a file with a PGP key for example or use one of the many other Cryptocx methods.

Cryptocx works perfectly in ASP.NET as well, please see the bottom of this page for dotNet (.NET) related code samples.

 

Classic ASP  usage:

 <%
   Dim theText
   Dim thePassword
   Dim encText
   Dim objCryptocx

   theText= ""
   thePassword= ""

   theText = "Some text to encrypt"
   thePassword = "The Password"
  
   Set objCryptocx = Server.CreateObject("EasyByte_Software.Cryptocxv7")
  

   objCryptocx.LicenseKey = "DEMO" 
   objCryptocx.InputText = theText
   objCryptocx.Password = thePassword
  
   encText = objCryptocx.BlowFishStringEncrypt 

   Set objCryptocx = Nothing
  

   Response.write encText + vbCrLf
 %>

 

.NET related usage:

 

For use in dotNET (C#)

1) include in namespace - "using Cryptocxv7.dll;"
2) Class type is "Cryptocxv7Class" usage: "
Cryptocxv7Class objCryptocx=new Cryptocxv7Class();"


Here is some .Net sample code:


Cryptocxv7.dll.Cryptocxv7Class objCryptocx = new Cryptocxv7.dll.Cryptocxv7Class();

objCryptocx.InputText = "hello";

txtOutput.Text = objCryptocx.HashStringSHA();




For use in dotNET (VB.NET)

1) Make sure you add a reference to the project to "Cryptocxv7.dll"

Here is some VB.Net sample code:

Dim strEncrypted As String
Dim Cryptocx As EasyByte_Software.Cryptocxv7 = New EasyByte_Software.Cryptocxv7


Cryptocx.InputText = "Hello"
Cryptocx.Password = "somepass"
Cryptocx.LicenseKey = "DEMO"


strEncrypted = Cryptocx.AESStringEncrypt



This is for example some C# code that works with the dll:



using
Cryptocxv7.dll;


public static string BlowfishString(string strINPUT)
{
 try
 {
 
Cryptocxv7Class objCryptocx = new Cryptocxv7.dll.Cryptocxv7Class();

  objCryptocx.InputText = strINPUT;
  strEncrypted = (string)objCryptocx.BlowfishStringEncrypt();
 }
 catch
 {
  strEncrypted = "";
 }
 return strEncrypted;
}

 

 

 

Back to Contents Page

 

Click here to set this great site as your home page

Or click here to add it to your Favorites.

  
  
 

Copyright (c) EasyByte Software 1998-2008, info@easybyte.com