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

Encryption Problem

Bob
Hi
Problem. Generate valuable 'plain' data on Mach A. Need to write encrypted
version to CD which gets inputed to database on mach B.
Want the data to be encrypted in the table so it cannot be eyeballed to see
data.
'Plain' data gets inputted by application to Mach B, if valid match Mach B
takes action.
So...
Problem is that RijndaelManaged is too smart for the job seeing that gives a
unique encryption for the same plain data each time it is invoked.
ie I can't encrypt the plain text input on Machine B and compare it to the
database string that was originally generated on Mach A because they are two
different strings.
Obviously sequentially decrypting each item in the database table for a
match check is out of the question.
I realise I am asking for a weakened algorithm here but it is only the
viewing of the data by personnel of low end skills that I am trying to
protect against.

TIA
Bob
Apr 15 '06 #1
5 1194
Bob
Hmmm,
From reading it appears that I need a hash. say MD5. But isn't there a
finite possibility that two different inputs may yield the same hash?
Thanks
Bob
"Bob" <bo*@nowhere.com> wrote in message
news:eK**************@TK2MSFTNGP02.phx.gbl...
Hi
Problem. Generate valuable 'plain' data on Mach A. Need to write encrypted
version to CD which gets inputed to database on mach B.
Want the data to be encrypted in the table so it cannot be eyeballed to see data.
'Plain' data gets inputted by application to Mach B, if valid match Mach B
takes action.
So...
Problem is that RijndaelManaged is too smart for the job seeing that gives a unique encryption for the same plain data each time it is invoked.
ie I can't encrypt the plain text input on Machine B and compare it to the
database string that was originally generated on Mach A because they are two different strings.
Obviously sequentially decrypting each item in the database table for a
match check is out of the question.
I realise I am asking for a weakened algorithm here but it is only the
viewing of the data by personnel of low end skills that I am trying to
protect against.

TIA
Bob

Apr 15 '06 #2
Bob <bo*@nowhere.com> wrote:
From reading it appears that I need a hash. say MD5. But isn't there a
finite possibility that two different inputs may yield the same hash?


Yes, in the same way that there's a finite possibility that you'll be
hit by a meteorite instead of getting this post.

However, you need to understand that you can't decrypt a hash - it's
one way. Do you actually need to decrypt the data on machine B?

Note that even with Rijndael I believe you'll get the same result if
you make sure you use the same IV and key both times.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Apr 15 '06 #3
On Sat, 15 Apr 2006 15:46:04 +1200, "Bob" <bo*@nowhere.com> wrote:
Hmmm,
From reading it appears that I need a hash. say MD5. But isn't there a
finite possibility that two different inputs may yield the same hash?
Thanks
Bob


The chance of collision (two strings having the same hash value) is
quite small when using a resonably large hash. The chance of two
single hashes colliding when using MD5 is 1 in 2^128. The chance of
course grows when you have several hashes, but it remains extremly
small.

What you are doing sounds like storing encrypted passwords which is a
very common use of hashing.

--
Marcus Andrén
Apr 15 '06 #4
Bob
Hi Jon & Marcus,
Thank you for your replies,
The MD5 permutations are far greater than the permutations of the 20 digit
input number I am dealing with.
I didn't understand the scope of the MD5.
I can ensure uniqueness with an index on the database field. So the initial
insert will fail if I do get a 'meteror strike'
With regard to the Rijndael,
It does generate different results for the same input data each time it
encrypts, of course they all decrypt back to the correct input data. I had
sailed happily down the development stream with the Rijndael until this rock
appeared.
regards
Bob

"Bob" <bo*@nowhere.com> wrote in message
news:uE**************@TK2MSFTNGP03.phx.gbl...
Hmmm,
From reading it appears that I need a hash. say MD5. But isn't there a
finite possibility that two different inputs may yield the same hash?
Thanks
Bob
"Bob" <bo*@nowhere.com> wrote in message
news:eK**************@TK2MSFTNGP02.phx.gbl...
Hi
Problem. Generate valuable 'plain' data on Mach A. Need to write encrypted version to CD which gets inputed to database on mach B.
Want the data to be encrypted in the table so it cannot be eyeballed to see
data.
'Plain' data gets inputted by application to Mach B, if valid match Mach B takes action.
So...
Problem is that RijndaelManaged is too smart for the job seeing that gives a
unique encryption for the same plain data each time it is invoked.
ie I can't encrypt the plain text input on Machine B and compare it to

the database string that was originally generated on Mach A because they are

two
different strings.
Obviously sequentially decrypting each item in the database table for a
match check is out of the question.
I realise I am asking for a weakened algorithm here but it is only the
viewing of the data by personnel of low end skills that I am trying to
protect against.

TIA
Bob


Apr 15 '06 #5
Bob <bo*@nowhere.com> wrote:
Thank you for your replies,
The MD5 permutations are far greater than the permutations of the 20 digit
input number I am dealing with.
I didn't understand the scope of the MD5.
I can ensure uniqueness with an index on the database field. So the initial
insert will fail if I do get a 'meteror strike'
Right.
With regard to the Rijndael,
It does generate different results for the same input data each time it
encrypts, of course they all decrypt back to the correct input data. I had
sailed happily down the development stream with the Rijndael until this rock
appeared.


Even with the same key and IV? That surprises me. Changing the test
program from MSDN to use the same key and IV each time gives me the
same encrypted data each time...

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Apr 15 '06 #6

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

Similar topics

34
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? ...
1
by: Cliff | last post by:
We are trying to connect to 3 different Oracle databases using MS Access as the front-end and ODBC as the connection. The problem that we are having is that 1 of the databases requires a...
2
by: gaurav khanna | last post by:
Hi I need to store the credit card information in my database. I have been looking for some third party tools which could provide encryption for credit card numbers. The help I need is: a)...
113
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...
2
by: almurph | last post by:
Hi everyone, Can you help me please? I am having a problem with the encryption/decryption of words with the Irish fada in them. The Irish fada is like this: áéíóú/ÁÉÍÓÚ. It's kind of like the...
11
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...
8
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...
22
by: Wilson | last post by:
i am learning to program using c++ and was set a task of making a simple encryption algorithim. I choose to start with one where simply each letter is replaced with its equivilent in the alphabet...
19
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...
3
by: =?Utf-8?B?TG9yZW4=?= | last post by:
I’m trying to encrypt and decrypt a file in vb.net. I am using the TripleDESCryptoServiceProvider encryption found in System.Security.Cryptography. Below is the code for my Encrypt and Decrypt...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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$) { } ...
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
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?
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.