.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

MySQL - AES Encryption

Posted By:      Posted Date: October 04, 2010    Points: 0   Category :.NET Framework

Hi all,

I need some help down here.

1. My SQL Field - Last name, first name , middle name (are encrypted field using AES)

2. I need to do display all the rows using PAGING on my C# Application.

3. Order by Last Name, First Name then Middle Name.

However, i cant do so as i cant sort in Mysql as this field is Encrypted.

I had 700k records, will have run out of memory error if i select all records, start to decrypt and do a sorting.

Please advise.



View Complete Post

More Related Resource Links

View State Encryption


Hi All,

Why is it that I see the same hash value generated when I use different algorithms for viewstate encryption. I have added below lines to the web.config file

<pages viewstateEncryptionMode="Always"

Individual field - MySQL



I was wondering how to recieve an individual field from my MySQL database.

I have been able to get a row, but what I am trying to do is get a name from my database and set it into the HeaderText in my DataGrid.

The way I am trying to do it at the moment is

using (OdbcCommand cmd = new OdbcCommand(formQuery, con))
                formDataGrid.Columns[0].HeaderText = cmd.ExecuteReader(
                    CommandBehavior.CloseConnection |

This doesn't seem to get a value from the GetValue, but if use

using (OdbcCommand cmd = new OdbcCommand(formQuery, con))
                formDataGrid.DataSource = cmd.ExecuteReader(
                    CommandBehavior.CloseConnection |

it will bind my data into the grid.

I just want to be able to change the HeaderText in the first coulmn of the DataGrid from one table and have the DataGrid be filled from another table.

I can fill the DataGrid its just changing the HeaderText that I am having trouble with.

Any help?

search in mysql database, mvc



I have set up a mysql connection in visual studio 2010 and now i have a connection and dont really know where to go next.

I want to be able to search the data and get the result in a view.

using asp.net mvc

Using LINQ and MySQL


Hi. I am wondering if its possible to use LINQ and MySQL?

I am build as .NET MVC, i have set up my MySQL connection and want to retrive the data and display it in a view, how is this done?

Can i use LINQ or something else or should dont use it at all.

// Thanks

Saving textbox data to MySql database in asp.net


Hi dear coders

though a very simple question to ask, but please tell me how to save and retrieve data in/from my textboxes to/from database (MYSQL) on submit button click.

i know its a very simple task but i cant make it done, so i request you to please send me some working example link or post any helpful code here in asp.net

i will be highly thankful for any kind help from you geniuses.



MySql.Data assembly problem



I added refernece MySql.Data to my project. My web.config looks like that:

<?xml version="1.0"?>
                <add assembly="MySql.Data, Version=, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>

But when in ServerExplorer I try "Add Connection..." I can't find "MySql Database" in the "Choose Data Source" dialog box?

What the problem can be?

Cryptography: Employ Strong Encryption in Your Apps with Our CryptoUtility Component


When storing sensitive data, you need to be able to identify threats, determine how these threats interact with each other, and how issues can combine to constitute a vulnerability that will leave your data exposed. With a good understanding of the various cryptographic algorithms, salt, hashes, ACLs, and other available techniques, you'll be in a better position to protect your critical data.

Michael Stuart and J Sawyer

MSDN Magazine November 2004

Trustworthy Code: Exchange Data More Securely with XML Signatures and Encryption


You can sign any kind of data using XML Signature, including part of an XML document, other XML documents, or other data of any format. However, in practice, XML signatures are most frequently used to sign other data represented in XML. In this article, the authors discuss the new standard and how you can benefit from it in your apps.

Mike Downen and Shawn Farkas

MSDN Magazine November 2004

Encrypt It: Keep Your Data Secure with the New Advanced Encryption Standard


The Advanced Encryption Standard (AES) is a National Institute of Standards and Technology specification for the encryption of electronic data. It is expected to become the accepted means of encrypting digital information, including financial, telecommunications, and government data. This article presents an overview of AES and explains the algorithms it uses. Included is a complete C# implementation and examples of encrypting .NET data. After reading this article you will be able to encrypt data using AES, test AES-based software, and use AES encryption in your systems.

James McCaffrey

MSDN Magazine November 2003

.NET Remoting: Secure Your .NET Remoting Traffic by Writing an Asymmetric Encryption Channel Sink


As .NET Remoting gains popularity in the enterprise space, it must meet business demands for trustworthy computing. Remoting traffic can be secured when objects are hosted in IIS, but when they aren't hosted in IIS, custom security solutions can be developed to secure them. This article provides an in-depth look at writing channel sinks for .NET. It also details the flow of data through custom channel sinks and explains the kinds of manipulations that can be performed on that data.

Stephen Toub

MSDN Magazine June 2003

get the last inserted row ( autoincrement id ) in mysql database back


In my mysql I have an autoincrement id , whenever I add a new row into database I need to store this id in other table, so how to get this autoincrement Id back?

Symmetric Key Encryption on the Compact Framework

There are two main types of encryption algorithms available within the .NET Compact Framework - symmetric and asymmetric encryption. This blog entry will discuss how to utilise symmetric key encryption, but first we have to outline the difference between Symmetric and Asymmetric encryption (I will discuss asymmetric key encryption in a future blog entry).

Symmetric and Asymmetric Key Encryption
Symmetric encryption algorithms (also known as ciphers) process plain text with a secret encryption key to create encrypted data (called cipher text). The same secret key is used to decrypt the cipher text back to plain text.

Asymmetric encryption (also known as public-key encryption) is a cryptography technique that uses public and private key pairs to encrypt and decrypt data respectably. The private key is a closely guarded secret, while the public key can be freely distributed over untrusted networks. You do not worry who has your public key (you could print it on a 100foot tall banner if you so desired), but you must keep your private key secret.

URL Encryption in ASP.NET


Hi Friends

URL Encryption is important in project ...

i m using following artical for URl Encryption... It is working fine for Respons.redirect();

But not working for navigate url ....

how can this problem get resolved ...

please help me out...........


----------------------------------------------------------------------------------------------------------------------------------- Parees Solutions -----------------------------------------------------------------------------------------------------------------------------------

convert mysql to mssql


HI All,

I am looking for the ms sql syntax for this

mysql> UPDATE Books, Orders
    -> SET Orders.Quantity=Orders.Quantity+2,
    ->    Books.InStock=Books.InStock-2
    -> WHERE Books.BookID=Orders.BookID
    ->    AND Orders.OrderID = 1002;


mysql and vb.net connection


Dear All,

May I ask the following questions?

1.  How can I connect mysql to vb.net and showing it for example on a gridview?

2.  How can I use membership roles and username then linking it on my database?  Ex.  If i have employees table it should have link the username and password on the aspdbnet table?  Thanks. 

Encryption/Decryption OAEP

I have some code: string newKey = AmazonFeedBrowser.Security.CryptoKeyContainer.GetKeyFromContainer("KeyContainer", true); RSACryptoServiceProvider trsa = new RSACryptoServiceProvider(); trsa.FromXmlString(newKey); string tu = Convert.ToBase64String(trsa.Encrypt(Encoding.UTF8.GetBytes("Administrator"), true)); Debug.WriteLine(tu); newKey = AmazonFeedBrowser.Security.CryptoKeyContainer.GetKeyFromContainer("KeyContainer", false); trsa = new RSACryptoServiceProvider(); trsa.FromXmlString(newKey); Debug.WriteLine(Encoding.UTF8.GetString(trsa.Decrypt(Convert.FromBase64String(tu), true))); I get a cryptographic exception indicating that the OAEP padding cannot be processed. The RSACryptoServiceProvider (trsa) is initialized with just the public key. It seems to work OK with the public and private key. Is there a way to use OAEP with just the public key? Error occurred while decoding OAEP padding. System.Security.Cryptography.CryptographicException was unhandled Message=Error occurred while decoding OAEP padding. Source=mscorlib StackTrace: at System.Security.Cryptography.RSACryptoServiceProvider.DecryptKey(SafeKeyHandle pKeyContext, Byte[] pbEncryptedKey, Int32 cbEncryptedKey, Boolean fOAEP, ObjectHandleOnStack ohRetDecryptedKey) at System.Security.Cryptography.RSACryptoServiceProvider.Decrypt(Byte[] rgb, Boolean fOAEP) .

Import contacts on Mysql

Hello,   I am in the process of transferring data and contacts onto a Mysql database. I have had some help and am trying to get a software solution.   So main features would be to migrate large amounts of data and contacts every day. The migration would be done manually.  Thanks for the help.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend