473,396 Members | 1,827 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,396 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 1744
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.