473,386 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Trying to use Cryptography Quickstart

BK
I downloaded and installed the Enterprise Library for .NET Framework
2.0 - January 2006. I ran the Cryptography Quickstart and it works
perfect. It does exactly what I need it to do, encrypts a string and
decrypts a string.

I copy the few lines of code (it looks SO easy at this point):

Const symmProvider As String = "symprovider"
Dim stringToEncrypt As String = Me.TextBoxOriginalValue.Text
Dim encryptedContentsBase64 As String
encryptedContentsBase64 =
Microsoft.Practices.EnterpriseLibrary.Security.Cry ptography.Cryptographer.EncryptSymmetric(symmProvi der,
stringToEncrypt)
Me.TextBoxEncrypted.Text = encryptedContentsBase64

and it gives me an error on the call to EncryptSymmetric. The error I
get is:

"Could not load file or assembly
'Microsoft.Practices.EnterpriseLibrary.Common, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=null' or one of its dependencies. The
system cannot find the file specified."

So I realize that I need a reference to another dll, I add that
reference, run it again and now I get an error message:

"The type initializer for
'Microsoft.Practices.EnterpriseLibrary.Common.Conf iguration.ObjectBuilder.EnterpriseLibraryFactory'
threw an exception."

I hoped that using the recommendation from Microsoft would be easier,
but I'm not getting it. I'm guessing at this point that I've missed
some step along the way, but I have no clue where to go at this point.
Any suggestions?

Jul 17 '06 #1
4 2715
BK,

Did you set a reference.

There are many methods to do that, one is using the tab Project, in that Add
references and than browse
to where you have placed that downloadedfile.

I hope this helps,

Cor

"BK" <bk******@hotmail.comschreef in bericht
news:11**********************@p79g2000cwp.googlegr oups.com...
>I downloaded and installed the Enterprise Library for .NET Framework
2.0 - January 2006. I ran the Cryptography Quickstart and it works
perfect. It does exactly what I need it to do, encrypts a string and
decrypts a string.

I copy the few lines of code (it looks SO easy at this point):

Const symmProvider As String = "symprovider"
Dim stringToEncrypt As String = Me.TextBoxOriginalValue.Text
Dim encryptedContentsBase64 As String
encryptedContentsBase64 =
Microsoft.Practices.EnterpriseLibrary.Security.Cry ptography.Cryptographer.EncryptSymmetric(symmProvi der,
stringToEncrypt)
Me.TextBoxEncrypted.Text = encryptedContentsBase64

and it gives me an error on the call to EncryptSymmetric. The error I
get is:

"Could not load file or assembly
'Microsoft.Practices.EnterpriseLibrary.Common, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=null' or one of its dependencies. The
system cannot find the file specified."

So I realize that I need a reference to another dll, I add that
reference, run it again and now I get an error message:

"The type initializer for
'Microsoft.Practices.EnterpriseLibrary.Common.Conf iguration.ObjectBuilder.EnterpriseLibraryFactory'
threw an exception."

I hoped that using the recommendation from Microsoft would be easier,
but I'm not getting it. I'm guessing at this point that I've missed
some step along the way, but I have no clue where to go at this point.
Any suggestions?

Jul 18 '06 #2
BK
Yes, I set a reference.

Cor Ligthert [MVP] wrote:
BK,

Did you set a reference.

There are many methods to do that, one is using the tab Project, in that Add
references and than browse
to where you have placed that downloadedfile.

I hope this helps,

Cor

"BK" <bk******@hotmail.comschreef in bericht
news:11**********************@p79g2000cwp.googlegr oups.com...
I downloaded and installed the Enterprise Library for .NET Framework
2.0 - January 2006. I ran the Cryptography Quickstart and it works
perfect. It does exactly what I need it to do, encrypts a string and
decrypts a string.

I copy the few lines of code (it looks SO easy at this point):

Const symmProvider As String = "symprovider"
Dim stringToEncrypt As String = Me.TextBoxOriginalValue.Text
Dim encryptedContentsBase64 As String
encryptedContentsBase64 =
Microsoft.Practices.EnterpriseLibrary.Security.Cry ptography.Cryptographer.EncryptSymmetric(symmProvi der,
stringToEncrypt)
Me.TextBoxEncrypted.Text = encryptedContentsBase64

and it gives me an error on the call to EncryptSymmetric. The error I
get is:

"Could not load file or assembly
'Microsoft.Practices.EnterpriseLibrary.Common, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=null' or one of its dependencies. The
system cannot find the file specified."

So I realize that I need a reference to another dll, I add that
reference, run it again and now I get an error message:

"The type initializer for
'Microsoft.Practices.EnterpriseLibrary.Common.Conf iguration.ObjectBuilder.EnterpriseLibraryFactory'
threw an exception."

I hoped that using the recommendation from Microsoft would be easier,
but I'm not getting it. I'm guessing at this point that I've missed
some step along the way, but I have no clue where to go at this point.
Any suggestions?
Jul 18 '06 #3
Sorry,

I have overlooked that. You use Visual Studio 2005 as I may assume?

Cor

"BK" <bk******@hotmail.comschreef in bericht
news:11**********************@m73g2000cwd.googlegr oups.com...
Yes, I set a reference.

Cor Ligthert [MVP] wrote:
>BK,

Did you set a reference.

There are many methods to do that, one is using the tab Project, in that
Add
references and than browse
to where you have placed that downloadedfile.

I hope this helps,

Cor

"BK" <bk******@hotmail.comschreef in bericht
news:11**********************@p79g2000cwp.googleg roups.com...
>I downloaded and installed the Enterprise Library for .NET Framework
2.0 - January 2006. I ran the Cryptography Quickstart and it works
perfect. It does exactly what I need it to do, encrypts a string and
decrypts a string.

I copy the few lines of code (it looks SO easy at this point):

Const symmProvider As String = "symprovider"
Dim stringToEncrypt As String = Me.TextBoxOriginalValue.Text
Dim encryptedContentsBase64 As String
encryptedContentsBase64 =
Microsoft.Practices.EnterpriseLibrary.Security.Cry ptography.Cryptographer.EncryptSymmetric(symmProvi der,
stringToEncrypt)
Me.TextBoxEncrypted.Text = encryptedContentsBase64

and it gives me an error on the call to EncryptSymmetric. The error I
get is:

"Could not load file or assembly
'Microsoft.Practices.EnterpriseLibrary.Common, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=null' or one of its dependencies. The
system cannot find the file specified."

So I realize that I need a reference to another dll, I add that
reference, run it again and now I get an error message:

"The type initializer for
'Microsoft.Practices.EnterpriseLibrary.Common.Conf iguration.ObjectBuilder.EnterpriseLibraryFactory'
threw an exception."

I hoped that using the recommendation from Microsoft would be easier,
but I'm not getting it. I'm guessing at this point that I've missed
some step along the way, but I have no clue where to go at this point.
Any suggestions?

Jul 18 '06 #4
BK
No problems, yes I use VS 2005.
Sorry,

I have overlooked that. You use Visual Studio 2005 as I may assume?

Cor
Jul 18 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andrzej | last post by:
Hi, I have to figure out why we have a problem with special characters in encrypted usernames and passwords. Case: Username: r&bgeorge Password: tigger
1
by: Luboą ©lapák | last post by:
Hi, I need encrypt string with using one key. Write please short example, how can I do it? Thanks Lubos
1
by: Abhishek Srivastava | last post by:
Hello All, I have installed the quick start samples that come along with .net sdk. I am facing some strange behavior on my machine. I would be gratefull if someone could explain what is going...
2
by: Paul | last post by:
Hi, I'm pretty new to ASP.NET so not even sure how to do this correctly. On a webpage I want to display a table with rows of data from a database table (that bit I can do using datagrids etc). ...
0
by: EP | last post by:
I have a WSE server app that uses the <cryptography> element in the configuration (seen below). This worked perfectly in WSE sp1, but when I upgraded to SP2 and then to SP3, I get the following...
1
by: muthu | last post by:
Hi, I have two web applications running on my machine.The application is developed using asp.net 1.1 and vb.net.When i try to run both the applications in the same browsers, i get the following...
1
by: =?Utf-8?B?ZGF2aWQ=?= | last post by:
Hi, everybody here. I am implementing data encryption/decryption, and try to use System.Security.Cryptography.TripleDESCryptoServiceProvider. But I can not find it in MS Visual Studio when I...
4
by: Jeff | last post by:
I've been attempting to find the answer, but don't know what to search for. If someone could get me started, I can figure the rest out. I'm using visual web 2005 with vb. The following works...
6
by: andrew | last post by:
Hi, I have a web service application written in C# .NET 1.1 using MD5CryptoServiceProvider.ComputeHash(Byte) The problem is that after a while(web service processes requests) the call throws...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.