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

AES and Credit card number encryption

I browsed this subject and thought I might use the
'AES' cypher scheme to do this. Would this be
a good choice?

I came across a "Python Cryptography Toolkit"

http://www.amk.ca/python/code/crypto

which has a nice AES implementation, but in
the example, a simple string is passed as the
key:

obj=AES.new('abcdefgh', AES.ECB)

So my real question is, how do I go about
generating the best key. Isn't the length
supposed to be a 2^n bits, and soforth?

Thanks,

Tobiah

--
Posted via a free Usenet account from http://www.teranews.com

Jan 22 '07 #1
3 2963
Tobiah <to**@tobiah.orgwrites:
I browsed this subject and thought I might use the 'AES' cypher
scheme to do this. Would this be a good choice?
There's more to it than that, but yes, AES is a good underlying
algorithm.
So my real question is, how do I go about generating the best key.
Isn't the length supposed to be a 2^n bits, and soforth?
AES key length is your choice of 128, 192, or 256 bits. In practice
128 bits (16 bytes) is fine and is what most people use. You should
use 16 completely random bytes. Get these by reading them from
os.urandom(16), which is provided for basically this purpose.
Jan 22 '07 #2
Paul Rubin wrote:
Tobiah <to**@tobiah.orgwrites:
>I browsed this subject and thought I might use the 'AES' cypher
scheme to do this. Would this be a good choice?

There's more to it than that, but yes, AES is a good underlying
algorithm.
Looking at the problem further, I am getting the idea that
PGP, or GPG (Asymetric encryption) would be better, because
then all of the software that has to *write* CC numbers, would
not have to access the 'secret' key. You see we have to write
the number often, but almost always only have to access (read)
a masked number (4232********3435).

PGP sounds great, but it seems like a huge subject to cover
in a day or two. Is there a nice module for python that would
let me do the most usual operations easily? I just want to make
a key, hide it, and the use the public key to encrypt all future
and past credit card numbers.

--
Posted via a free Usenet account from http://www.teranews.com

Jan 23 '07 #3
Tobiah <to**@tobiah.orgwrites:
Looking at the problem further, I am getting the idea that
PGP, or GPG (Asymetric encryption) would be better, because
then all of the software that has to *write* CC numbers, would
not have to access the 'secret' key.
Yes.
PGP sounds great, but it seems like a huge subject to cover
in a day or two. Is there a nice module for python that would
let me do the most usual operations easily? I just want to make
a key, hide it, and the use the public key to encrypt all future
and past credit card numbers.
I think I did hear of a GPG module. You can also call GPG as an
external library. There are also modules around that do public-key
operations directly, or some like M2Crypto that use OpenSSL for public
key operations.

I wrote something a while back for applications pretty similar to
yours, but never released it. I should clean it up sometime. At the
moment I wouldn't consider it well-tested enough for deployment in
real applications, and also it currently doesn't support AES because
it was written to avoid using C extensions, so it used a nonstandard
pure-Python cipher.

http://www.nightsong.com/phr/crypto/crypto.txt

If you want to just encrypt stuff in pure Python and you don't mind
using a nonstandard (but reasonably secure, at least compared with the
old rotor module it was written to replace), it's here:

http://www.nightsong.com/phr/crypto/p3.py

Note that you get a ciphertext considerably longer than the plaintext.
This is unavoidable for various security reasons and a proper AES
setup (or a call to GPG) will be the same way.
Jan 23 '07 #4

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

Similar topics

1
by: revjjjames | last post by:
Hello, can someone please recommended a online credit card processor that is PHP friendly? I am seeking one that could be built into a hidden-frame, and process a transaction seamlessly this way. ...
6
by: Simon Wigzell | last post by:
My client wants to have credit card information fields on his forms for his website visitors to be able to buy his wervices by credit card. The credit card info - Brand, number and expiry date will...
1
by: Peter Rilling | last post by:
I am working on an application that will store credit cards in a database (basically a commerce application). What are some of the suggested ways of handling credit card data securely?
10
by: dries | last post by:
A friend of mine has a problem with his credit card validation routine and it is probably a simple thing to solve but I cannot find it. It has to do with the expiry dates. What happens is that as...
5
by: John | last post by:
Hi, I've always had the opinion that you don't store credit card numbers on a hosted website database. But it has occurred to me, that perhaps I am over reacting, and encrypted CC info may be...
6
by: Arne | last post by:
What would be a good component for processing credit cards? (I am not using commerce server.) Would I need to encrypt the credit card column in the database?
4
by: Jerry Camel | last post by:
I'm writing and ASP.net app using vb .net. I need to interact with a credit card reader. I have one that sits inline with the keyboard. Works great, except for the fact that no matter what field...
1
by: veg_all | last post by:
I am often surprised to see many websites require that the credit card not be entered with any spaces or dashes. This is very trivial to remove those characters that I wonder about the security of...
1
by: securedcardss | last post by:
http://card.2youtop.info secured credit card card credit instant secured card cash credit secured card
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: 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...
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
jinu1996
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...

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.