Skip to Main Content
C# Cookbook, 2nd Edition
book

C# Cookbook, 2nd Edition

by Jay Hilyard, Stephen Teilhet
January 2006
Intermediate to advanced content levelIntermediate to advanced
1184 pages
43h 23m
English
O'Reilly Media, Inc.
Content preview from C# Cookbook, 2nd Edition
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Storing Data Securely
|
971
Discussion
Random provides methods like Next, NextBytes, and NextDouble to generate random
information for integers, arrays of bytes, and doubles, respectively. These methods
can produce a moderate level of unpredictability, but to truly generate a more unpre-
dictable random series, you need to use the
RNGCryptoServiceProvider.
RNGCryptoServiceProvider can be customized to use any of the underlying Win32
Crypto API providers. You pass a
CspParameters class in the constructor to deter-
mine exactly which provider is responsible for generating the random byte sequence.
CspParameters allows you to customize items such as the key container name, the
provider type code, the provider name, and the key number used.
The
GetBytes method populates the entire length of the byte array with random
bytes.
See Also
See the “RNGCryptoServiceProvider Class,” “CspParameters Class,” and “Crypto-
graphic Provider Types” topics in the MSDN documentation.
17.8 Storing Data Securely
Problem
You need to store settings data about individual users for use by your application
and keep this data isolated from other instances of your application run by different
users.
Solution
You can use isolated storage to establish per-user data stores for your application
data and then use hashed values for ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C# Cookbook

C# Cookbook

Stephen Teilhet, Jay Hilyard
C# Cookbook

C# Cookbook

Joe Mayo
Head First C#, 4th Edition

Head First C#, 4th Edition

Andrew Stellman, Jennifer Greene

Publisher Resources

ISBN: 0596100639Supplemental ContentCatalog PageErrata