Java implementation of 3DES and DUKPT for decryption of credit card reader data through keyboard emulation? -


we have online key-in interface, , support credit card swipe capability. in industry today, card reader should encrypt information before encoding ascii, , server-side decrypt. (so local machine never sees card info)

i using magtek card reader in keyboard emulation mode, , have ansi standard key injected testing purposes. once decode & decryption successful, we'll our own key registered magtek , order production-use readers.

i know decryption has been implemented before in c# , other languages, need in java, or perhaps other cli-accessible program can included java webapp. proceed porting c# code java, first need set c# environment. (i've never done before.)

once i've ensured c# version works well, know can eliminate errors during porting usual debugging techniques.

before go through of this, if there easier way please let me know. think has been done in java, perhaps not...

partial answer, cw add to.

first, it's not clear (to me) if want run on pcs or similar swipe devices are, possibly downloaded (like applet or webstart), or encrypted swipe data (in webform?) , send server decrypt. suggest latter makes pci dss compliance easier.

java crypto 3des, under name desede (case-insensitive, jca cipher names). 1 unobvious point: implementation in sunjce handles full 24-byte keys. dukpt uses "2-key 3des", need copy "left" bytes 0-7, "right" 8-15, , "left" again 16-23. if use bouncycastle (as shop does) can take 16-byte key , copy internally, more convenient. (a symmetric key in java byte array in thin wrapper class, javax.crypto.spec.secretkeyspec.)

if you're not familiar java crypto in general, pattern obtain "instance" of particular algorithm or mode "provider" (you can specify 1 or let java choose automatically; several builtin , more can added, "bcprov" www.bouncycastle.org) using generic api class cipher, signature, messagedigest, etc, initialize instance needed parameters (such key or iv, , direction), call methods take input data , return output either in separate (possibly multiple) steps or in simple combined dofinal (which fine case). jca manual http://docs.oracle.com/javase/8/docs/technotes/guides/security/crypto/cryptospec.html#cipher , javadoc applicable api class javax.crypto.cipher (at http://docs.oracle.com/javase/8/docs/api/index.html , automatically displayed in leading ides) has quite full details on this.

i haven't seen open/free implementation of dukpt doesn't prove there isn't one. straightforward, though bit tedious, code steps x9.24, if no 1 offers better.


Comments

Popular posts from this blog

java - Could not locate OpenAL library -

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

sorting - opencl Bitonic sort with 64 bits keys -