Help me how to use Cryptography Application Block !

Topics: Caching Application Block , Cryptography Application Block, Data Access Application Block, Enterprise Library Core, Exception Handling Application Block, General discussion, Security Application Block
Jul 21, 2008 at 6:59 PM
I've build a small application using Web service software factory and Smartclient Software factory architect.
And now I want to upgrade my application in offline mode. So I use Caching Applicaiton Block to store some data in my local machine (I use backingstore IsolatedStorage) .
 But I want to encrypt my data that stored in my local machine (that's in C:\Documents and Settings\User name\Local Settings\Application Data\IsolatedStorage) to make my data more secure. How can I do now ? Help me please.

and more question : In stead of using IsolateStorage to archive my data , I want to use an other database like Sql CE (compact edition) to store my data. Suggest me some information please . Thanks much
Jul 21, 2008 at 7:33 PM
Hi,

The caching block has built-in support for encryption, but unfortunately is neither well documented nor easily discoverable. Using the configuration tool add a storage encryption provider by right-clicking on your backing store node and select the crypto block's encryption provider to use.

There's also support for a Database Cache Storage as an alternative to the Isolated Storage one, just remove the existing backing store and add a new one of the right type. You should be able to use it with a connection string for a SqlCE database.

Hope this helps,
Fernando




thanhiph wrote:
I've build a small application using Web service software factory and Smartclient Software factory architect.
And now I want to upgrade my application in offline mode. So I use Caching Applicaiton Block to store some data in my local machine (I use backingstore IsolatedStorage) .
 But I want to encrypt my data that stored in my local machine (that's in C:\Documents and Settings\User name\Local Settings\Application Data\IsolatedStorage) to make my data more secure. How can I do now ? Help me please.

and more question : In stead of using IsolateStorage to archive my data , I want to use an other database like Sql CE (compact edition) to store my data. Suggest me some information please . Thanks much



Jul 22, 2008 at 3:36 AM
Edited Jul 22, 2008 at 3:44 AM
thanks much for your suggestion. And I have some troubles before deciding using Sql CE database to archive my cache data.


My application is built in SmartClient and Webservice Factory so I have one machine called Service and many machines called Clients.


When Service and Clients are connected to each other, I don't use database from cache, I use directly database from Service. But in other way, when I have troubles in connected between Service and Clients (that means working offline), I must use data archive in Cache. And in this situation, I want all Clients use the cache that shared for all Clients machine


So I  think if I use SqlCE database , I can get good result. But I don't know how to config to let all Clients use the common cache database. Help me please. Thanks in avance.
Jul 22, 2008 at 12:09 PM
Hi,

SqlCE is an embedded database; you cannot share it among multiple clients. Also, a backing store is considered to be private to a single cache instance; if you share it then it would get out of sync with the in-memory representation.

But even if it worked, why would you want to do it? If the clients share the cache is because they expect to be aware of other clients and make things different, and that can get difficult to get right.

Also, keep in mind that a cache is by definition transient. Although you can avoid expirations, it doesn't seem to be the best fit for your scenario. Have you considered using the Microsoft Synchronization Services for ADO.NET? I haven't used it myself, but it looks like it targets the problem you need to solve.

Fernando




thanhiph wrote:
thanks much for your suggestion. And I have some troubles before deciding using Sql CE database to archive my cache data.


My application is built in SmartClient and Webservice Factory so I have one machine called Service and many machines called Clients.


When Service and Clients are connected to each other, I don't use database from cache, I use directly database from Service. But in other way, when I have troubles in connected between Service and Clients (that means working offline), I must use data archive in Cache. And in this situation, I want all Clients use the cache that shared for all Clients machine


So I  think if I use SqlCE database , I can get good result. But I don't know how to config to let all Clients use the common cache database. Help me please. Thanks in avance.