473,385 Members | 1,742 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,385 software developers and data experts.

DESCryptoProvider

Hi,
How can I use the DES Crypto Provider to take in a string and encrypt that
with a key then return an encrypted string and vica versa? All the examples
I have seen are based on files and streams.

Thanks.
Jul 21 '05 #1
2 1743
You don't have to use a filestream. This example uses a memorystream.

http://msdn.microsoft.com/library/en...yptortopic.asp
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
For a laugh, try web browsing with Opera's User Mode and Nostalgia enabled
Jul 21 '05 #2
If you use the CreateEncryptor/CreateDecryptor method, you will get an
object that implements ICryptoTransform. From there, you can use the
TransformBlock and TransformLastBlock methods directly (you must always use
TransformLastBlock when you pass in the last block of data, as padding is
often involved). Most block ciphers (like DES) support encrypting/decrypting
multiple blocks at a time, so you can actually pass in the entire "string".
I quoted string, becuse the method actually deals with byte arrays instead
of strings.
The CryptoStream is simply a mechanism that simplifies the process of moving
that byte data to a stream.

-Rob Teixeira [MVP]

<di********@discussion.microsoft.com> wrote in message
news:O2**************@TK2MSFTNGP09.phx.gbl...
Hi,
How can I use the DES Crypto Provider to take in a string and encrypt that with a key then return an encrypted string and vica versa? All the examples I have seen are based on files and streams.

Thanks.

Jul 21 '05 #3

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

Similar topics

2
by: | last post by:
Hi, How can I use the DES Crypto Provider to take in a string and encrypt that with a key then return an encrypted string and vica versa? All the examples I have seen are based on files and...
2
by: | last post by:
Hi, How can I use the DES Crypto Provider to take in a string and encrypt that with a key then return an encrypted string and vica versa? All the examples I have seen are based on files and...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.