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

Hashing

I am working on a pretty simple e-commerce web site that will sell our
company gift cards online. Our company and merchant policy prohibits us from
storing credit card numbers in any way once we clear the transaction using
Pay Flow. To help protect against fraud, I would like to know when the same
card number is used to make more than one purchase in a given period of
time.

Would hashing card numbers and then storing and comparing hashes work? Does
it still adhere to our company policy?

What would work better creditCard.ToHash() or using one of the SHA managed
providers?

-Andy
Sep 14 '06 #1
5 2136
Andrew Robinson schrieb:
Would hashing card numbers and then storing and comparing hashes work? Does
it still adhere to our company policy?
I´m not a security-expert, but I guess it would work. You only have to
be sure that you do not use any bad algorithm which allows re-hashing.

What you maybe can do... Create a public/private key-pair and delete the
private key.

Then you use the public key for hashing.

I´m not very sure but this should work. Try it out!
Regards,

Martin
Sep 14 '06 #2
IMO that should be OK (not a "legal" opinion ;-p). Soundss pretty normal.

Whenever storing a hash in a persistent system, you should use a known
algorithm, such as SHA, MD5, etc. The CLR GetHashCode() are liable to change
between runtime versions, which would break your system. For instance,
string.GetHashCode() is very different between 1.1 and 2.0.

Marc
Sep 14 '06 #3
Hi,
Would hashing card numbers and then storing and comparing hashes work?
Does it still adhere to our company policy?
Well it depends of what your policy says, IMO (IANAL ) it should be ok as
you can not regenerate the CC# from the hash
What would work better creditCard.ToHash() or using one of the SHA managed
providers?
I will go with something like SHA or MD5 just cause it's standard, later on
if you need to explain yourself you can say you use industry standard ( SHA,
etc ) to generate the hash
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Sep 14 '06 #4
Hi Andrew,

I'm not very experienced at the merchant policy, however, if the concern
here is only prevent clear text credit card number in memory or application
data. Using hashed value is an reasonable approach(and compare them using
hashed value also).

BTW, what's the "creditCard.ToHash()" you mentioned? Is this a particular
method of your custom credit card class type? As far as I know, you can
use the component classes under namespace to perform those crypto specific
operations(include hash, encrypt, signing...):

#Generating a Hash
http://msdn2.microsoft.com/en-us/library/w1t5hx6k.aspx

#Verifying a Hash
http://msdn2.microsoft.com/en-us/library/yeyw8w2d.aspx

Also, I would prefer SHA1 to MD5 since SHA1 is naturally stronger.

Hope this also helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.


Sep 15 '06 #5
Thanks everyone for all the info. Looks like I was heading down the correct
path here with SHA1 and we all agree.

--

Andrew Robinson
"Andrew Robinson" <ne****@nospam.nospamwrote in message
news:Oh****************@TK2MSFTNGP02.phx.gbl...
>I am working on a pretty simple e-commerce web site that will sell our
company gift cards online. Our company and merchant policy prohibits us
from storing credit card numbers in any way once we clear the transaction
using Pay Flow. To help protect against fraud, I would like to know when
the same card number is used to make more than one purchase in a given
period of time.

Would hashing card numbers and then storing and comparing hashes work?
Does it still adhere to our company policy?

What would work better creditCard.ToHash() or using one of the SHA managed
providers?

-Andy

Sep 15 '06 #6

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

Similar topics

2
by: Pat | last post by:
I want to look for some one-to-one hashing function. In C++, any one-to-one hashing function?
1
by: snowteo | last post by:
Hi,I have to do this exercises can you help me: 1)Write a program to implement exetendible hashing.If the table is small enough to fin in main memory,how does its performance compare with open and...
11
by: Wm. Scott Miller | last post by:
Hello all! We are building applications here and have hashing algorithms to secure secrets (e.g passwords) by producing one way hashes. Now, I've read alot and I've followed most of the advice...
10
by: Dino M. Buljubasic | last post by:
Hi, I am using MD5 to hash my passwords and add them to database as hashed. I have noticed though that some passwords don't get recognized and I suppose that it happen because hashing might...
19
by: Ole Nielsby | last post by:
How does the GetHashCode() of an array object behave? Does it combine the GetHashCode() of its elements, or does it create a sync block for the object? I want to use readonly arrays as...
8
by: Maya | last post by:
Hello all, I'm using MD5 hashing in my application to give unique values to huge list of items my application receives, originally every item's name was difficult to use as an id for this item...
6
by: Jayender | last post by:
Hi, What is the difference between Hashing and Encryption ?
4
by: wkatz | last post by:
Hi, Gurus. What hashing algorithm outputs hash value as numbers only? For example, if you pass a “John Q. Public” it will output 23324. If there is no such hashing, how hard is it to hire somebody to...
1
by: Tinku | last post by:
Hi friends I know Static Hashing and i know about Dynamic Hashing, still i have problem to make program with Dynamic Hashing I am new in "C" world, please help me, my problem is: i have to...
15
by: Vinodh | last post by:
I am reading about hashing techniques. The map data structure available in C++ STL uses hashing techniques?
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...
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,...
1
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.