Hi,
I am trying to encrypt and decrypt an XML string. I have it encrypting
but decrypting is a problem, somehow the XML is getting all corrupted.
Any ideas?
Im saving the XML text to a byte[] and then encrypting that using DES, and
writing it to a file and the reverse for reading it back in.
Thanks 3 1127
Can you post an example, and a little more detail about what is going
wrong?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
<di********@discussion.microsoft.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl... Hi,
I am trying to encrypt and decrypt an XML string. I have it encrypting but decrypting is a problem, somehow the XML is getting all corrupted.
Any ideas?
Im saving the XML text to a byte[] and then encrypting that using DES,
and writing it to a file and the reverse for reading it back in.
Thanks
I got it working, instead of storing as a binary file directly and using the
default CipherMode i now store as a base64string and use ECB so its the same
for the same keyusage.
I do get exceptions on keylenghts when i compute the MD5 hash on the key,
the key is 8 bytes as an example and hashed to 16 bytes.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:ez**************@TK2MSFTNGP12.phx.gbl... Can you post an example, and a little more detail about what is going wrong?
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
<di********@discussion.microsoft.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl... Hi,
I am trying to encrypt and decrypt an XML string. I have it
encrypting but decrypting is a problem, somehow the XML is getting all corrupted.
Any ideas?
Im saving the XML text to a byte[] and then encrypting that using DES, and writing it to a file and the reverse for reading it back in.
Thanks
<di********@discussion.microsoft.com> wrote in message
news:up****************@TK2MSFTNGP10.phx.gbl... I got it working, instead of storing as a binary file directly and using
the default CipherMode i now store as a base64string and use ECB so its the
same for the same keyusage.
I would recommend using CBC mode. ECB mode is more susceptible to
cryptanalysis. Feedback modes help obscure common patterns in the data.
Also, you might want to consider using an algorithm with a larger key. DES
is old-school encryption, has a weak key size, and is being replaced with
AES (which is basically the Rijndael algorithm for the block cipher part of
the spec).
Saving the XML to a common encoding (base64) probably fixed your real issue,
so again, consider going back to CBC mode. In addition, there may yet be a
descrepency between your encrypt/decrypt functions. It's hard to tell unless
you post the code.
I do get exceptions on keylenghts when i compute the MD5 hash on the key, the key is 8 bytes as an example and hashed to 16 bytes.
Hashes always compute a fixed-length result reguardless of how much data you
feed them as input. MD5 always results in 16 bytes even if the input is
bigger or smaller.
-Rob Teixeira [MVP] This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Chris |
last post by:
Hello all.
I'm currently working on a new site that encompasses the registration
of members. The registration is taking place through PHP interaction
with MySQL. The site is just going to be...
|
by: Blake T. Garretson |
last post by:
I want to save some sensitive data (passwords, PIN numbers, etc.) to
disk in a secure manner in one of my programs. What is the
easiest/best way to accomplish strong file encryption in Python? ...
|
by: Bonj |
last post by:
I was in need of an encryption algorithm to the following requirements:
1) Must be capable of encrypting strings to a byte array, and decyrpting
back again to the same string
2) Must have the same...
|
by: Alan Silver |
last post by:
Hello,
I am writing a page where sensitive data is collected (over SSL) and
stored in a database. I have been looking at the .NET encryption
classes, but am a bit confused as to which is best...
|
by: Chuck P |
last post by:
I need to deploy and asp.net 2.0 application that has dpapi/machine
encrypted connection strings.
I tried using the VS Build Publish menu selection and then putting the
encryption in the...
|
by: John Williams |
last post by:
I've written a simple program to do XOR encryption as my first foray
into understanding how encryption works. The code compiles fine, however
it segmentation faults on every run. using gdb to...
|
by: manmit.walia |
last post by:
Hello Everyone,
Long time ago, I posted a small problem I had about converting a VB6
program to C#. Well with the help with everyone I got it converted.
But I overlooked something and don't...
|
by: klenwell |
last post by:
Another request for comments here.
I'd like to accomplish something like the scheme outlined at this page
here:
http://tinyurl.com/3dtcdr
In a nutshell, the form uses javascript to hash...
|
by: Betikci Boris |
last post by:
I get bored last night and wrote a script that uses xor for encrypt-
decrypt, however it woks fine under linux 2.6.25, text and documents
are ok, but fails on compressed files *.jpg, *.pdf , etc ....
|
by: Jon.Hakkinen |
last post by:
Hi all,
I'm on DB2 9.5 fp 0 on Windows.
I have a simple SQL stored procedure which uses the Encrypt() function
to insert data in a table.
I do not set the encryption password inside the...
|
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,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
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...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
|
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,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |