28 August 2011

JCOP back again

JCOP
momentarily done with DEFire.  Glad to be back with a JCOP task.
Load a CAP.
Amazingly there seems to be only 1 Java level solution:

jcManager by  Stefan Braicu, source code available.

The Java Card  2.1.1 Virtual  Machine Specification does NOT provide a clear description of how to load a CAP.  The thousands of phone CAPs must all be loaded by 'utilities'. ie not by Java code.


01 August 2011

DESFire Transport Application, DESFire SAM RSA

We have reset a DESFire  Card and re-written the Transport Apps & files.
We know where the money is (in a "functional" file beneath a "logical file" in a physical file)
Wish I could say more but the card and the apps are under Non-Disclosures
Cant even get the docs in searchable form.

That aint no way to run a railroad, but it gives me a skillset I guess
______________________________________________________________________

DESFire SAM  AV2 does 2048 bit RSA


 Times to generate RSA keys (seconds) 10 runs:
 12.66   15.44   32.12   9.98    21.18   17.81   12.06   15.71   36.58   33.45
 roughly equivalent to an old 80386?

10 July 2011

Computers in NZ cont..

BioMatters is a world leader in DNA sequencing, gene assembling and tree forming.
Exporting to 29 Universities world-wide.
geneious



My list of interesting things to do with computers:

1) Search and Match DNA sequences: Craig Venter has a big DECAlpha farm to do the HGSequence.
- But turns out that I could have stayed in NZ to join a world class DNA outfit

2) Simulate explosions for the military
3) Simulate explosions for CGI movies, with Orcs running about.

2) apparently is fairly similar to 3) which had the USA DOD concerned when Peter Jackson assembled the biggest Intel Farm in Wellington for LOTR)
I left Wellington to travel the world, with CGI in mind. Who knew Wgtn would be the place?

3) handle large integers to enable secure transactions and identification

5) simulate the climate crash

6) manage your Audio and Video info, run the Internet, telescopes, traffic lights etc.

7) run businesses, ie databases

I lost interest in CGI (endless noisy orc/goblin battles) so settled for 3)

1) would have been the most fantastic career choice.


DNA searching is at first glance simple. Do a Boyer-Moore on sequences encoded at 2 bits per Base (there are 4 bases)
- I hear that Boyer-Moore has been improved since I implemented it in 16-bit Intel Assembler in the 90's

DNA has peculiarities: Some Base changes dont change the Amino Acid, so thats another layer of search.
Then theres functional search: Some AminoAcids can be replaced with no change in protein function - eg some may simply be 'hydrophilic' to insert in membrane.
Then there are enzyme 'active site' vs backbones, which may be swapped?

Then there are mutations: a single Base loss means a 'Frame Shift' so that all downstream codons are off.
Combine with translocations and jumping genes, some limited back mutation and metres of ancient ERV remnants and the game gets interesting.

Nature, in the form of the MHC and the immune system, hunts for Aa sequences about 5 Aas long thats 20^5 = 1 in 3 million.
Any less and the VanderW forces wouldnt hold, so that may be as important as the odds of uniqueness.
I dont know how many DNA bases in a typical Repressor/Activator sequence. Obviously activator proteins must act on more than one gene, if a gene is required to produce an activation.
This is where the most worthwhile computer stuff is. Its just so damned hard to do Biochem. Life molecules have a tendency to behave badly in the undergraduate lab.
__________________________________________________________________

NewsFlash: Low-Cost NFC in Turkey:
"another Huawei-made device has been spotted, this time in Turkey. Called Sonic (aka Huawei T20), it's a mid-range device with NFC capability and pre-loaded Gingerbread. Turkish Turkcell is offering it for 150 EUR" (NZD255)
engadget

30 June 2011

DESFire SAM AV2, NFC, N9, K Computer

Just "Activated" a DESFire SAM. ie converted it from AV1 to AV2
I can write keys to SAMs easily enough
but the commands to write keys to Cards are more obstruse
even with NXP's (confidential) Documents - hint... the documents occasionally have a "Standard" and also a "Worked Example"
which may contradict. Try the "Worked Example"

To write to Cards we tried to install the Collis Card Tool, but right now we appear to lack
Collis Conclusion Runtime Environment 2.1.2 -2.9.9
- Now thats why I like CDROM installs. People used to try to get Every Neccessary Thing on a CDROM...
_____________________________________________________________
first international NFC payments service is to go live this summer, Thierry Barba,...at Orange Group... GSMA's Mobile Money Summit in Singapore.

..Quick Tap NFC service, launched in the UK by Orange and Barclaycard last month will be able to use their NFC phones to make payments in Nice, the test site for the French Cityzi NFC project which is also backed by Orange. The French system is set for a nationwide commercial rollout of NFC services from the spring of 2012 and Orange expects to sell 500,000 NFC phones in France this year.

nearfieldcommunicationsworld
___________________________________________________________________
Nokia's N9 does NFC
MeeGo, the Linux-based open source operating system born from the February 2010 shotgun marriage of Nokia's Maemo and Intel's Moblin and left at the altar when Nokia hooked up with Windows Phone 7, is an "unstoppable force" that speeds device-developers' time-to-market..... MeeGo Conference in San Francisco on Monday by the executive director of The Linux Foundation Jim Zemlin

(local Store says they will have  GalaxySII 'soon" at ca $1,100)

nearfield
nearfield
viddler
nearfieldcommunicationsworld
___________________________________________________________________
The K Computer ....

Japan’s Riken Advanced Institute.. ..fastest supercomputers.
... peak 8.77 PFlop/s..sustained 8.2 PFlop/s [Peta = E15]

Previous: ..Tianhe-1.. November.. 4.7 PFlop/s, K does not use GPUs..It’s extremely difficult to exploit ..a GPU supercomputer.

K ... 68,544 2.0 GHz Fujitsu Sparc VIIIfx CPUs with 8 cores each, ..(548,352). Each core .. 16 (double-precision, DP) GFlop/s,.. slightly more than Intel.. Sandy Bridge..
45 nm chip .. 8 flop/clock/core.

8-core processor ...58 Watts.
currently 9.9 MWatts ..When finalized,... 10 PFlop/s ... 11 MWatts.
..human Brain .. 10 - 38 PFlop/s ... memory 3584 TB
we may be able to simulate a human brain next year or within 3 years.

conceivablytech

16 June 2011

Java Distribution, SwingWorker

Java Distribution
OK one more time: Java Distro made easy:

if using Netbeans: (bad GUI IDE...)

Right click on the dist folder, send it to a compressed folder
this will put the lib directory in place with all your extra jars.

do NOT futz with classpath... it wont do any good Java is notorious for not finding jars,
and deceiving about CLASSPATH

put a batch file called fred.bat
java -jar fred.jar
in the dist directory before you zip it.

In my old age I am finally writing static libraries of common functions.
But I am not permitted to do static imports,which nicely hide the class names...
_____________________________________________________
SwingWorker
Java Swing is NOT threadsafe - beware the black screen, which only task manager can kill

You need a silly thing called SwingWorker if your gonna wait for a card etc...


void SAM() //Button action HOT Switching SAMs
{
    UID = "";
    tSAM.setText("Insert SAM ");
    if (cardTerms == null)
    initTerms(); // make a list of all teminals: java does this nicely   

//_________________________________________________________


    SwingWorker waitForSAM = new SwingWorker()
    {
        public String doInBackground()
    {
    do
    {
       
 tryAllTermsCL(true); // <<<< find a SAM on a NonNFC reader
                                              

// do as much SAM/Card dependent stuff as you can, here, inside the SwingWorker..                                                                


        if (this.isCancelled()) // ideally have a Cancel button
             exit return("can"); 
    
     } 
     while ( UID.length() < 2); 

         publish(UID); //publish an update, this will get added to a list and processed in bulk by the process() method at some point 
     try 
     { 
         Thread.sleep(150); // let a cancel in?? 
     }
     catch (InterruptedException e) 
     {    
         System.out.println("Irrrrr"); 
         return("rupt"); 
     } 
     return("blank"); 
     } 
     @Override protected void process(List    chunks) 
     {
         //System.out.println("\n process " + chunks);

     }

        @Override
        protected void done()
        {
            tSAM.setText(UID);
        } // done
    }; //waitForCard definition fin

//_________________________________________________________
    waitForSAM.execute();

// card wait stuff done here may cause black-screen.....

    tArea.setCaretPosition(tArea.getDocument().getLength());


14 June 2011

HSM, NFC, GPU, Kindle Dash

HSM
I made a true triple DES key, loaded it into a HSM (software emulation)
It gave a correct KCV (encryption of 00..00) which had me fooled
But upon extraction (getKey) it gave a different result
Conclusion HSM double DES only!
____________________________________________________


Android 2.3.3 release, Google has added new capabilities for developers, including updates to the API ... that now allow for both reading and writing to standard NFC tags.
Dude..... its about more than tags
- we have a Nexus S in the office, it almost works for our reload app...
hope I can get some time to play with it (NZ1100?)

According to the Android Developers blog, some of the new features include:


A comprehensive NFC reader/writer API that lets apps read and write to almost any standard NFC tag in use today.
Advanced Intent dispatching that gives apps more control over how/when they are launched when an NFC tag comes into range.
Some limited support for peer-to-peer connection with other NFC devices.
For end users of NFC-enabled Android devices, what this means is that applications now have more control about how they are launched when an NFC tag is read. For example, apps could listen for specific tag content or tag technologies, and only launch when a match was made. Plus, applications running in the foreground could stop another app from launching upon the tag reading event, if need be.


The updated platform also provides a limited peer-to-peer communication protocol
http://android-developers.blogspot.com/2011/02/android-233-platform-new-nfc.html
NFC-A (ISO 14443-3A)
• NFC-B (ISO 14443-3B)
• NFC-F (JIS 6319-4)
• NFC-V (ISO 15693)
• ISO-DEP (ISO 14443-4)
• Mifare Classic
• Mifare Ultralight
NFC Forum NDEF tags
androidcommunity

developer.android
____________________________________________________

.Graphics Processing Unit  for cracking passwords..the GPU produces the correct password in a fraction of the time. On a Windows machine he pitted the Cain password recovery tool which uses the CPU for its calculations against ighashgpu which uses ATI or Nvidia graphics cards to do the deed. Hands down ighashgpu is the fastest; with Cain taking about one year to crack an eight character password while ighashgpu can do it in under nineteen hours.

hackaday
.....................................
GPGPU computing ... doing general calculations on graphic cards (GPUs) rather than CPUs. ... GPUs ... rendering frames .... people started realizing that GPUs are far more efficient at handling highly parallel tasks ... GPUs are used to speed up video conversion, video processing, doing scientific calculations, folding and password hash cracking.
ighashgpu.
golubev

how many passwords the GPU has churned out per second. Dude, it’s 3.334 billion passwords.

wordpress
____________________________________________________

Kindle seems nifty. But : dash it!
lunascafe typography-is-about-reading-and-so-are
____________________________________________________

29 May 2011

Nexus S Secure Element, Google Wallet

Nexus S does NFC but has no µSD Slot
Google&Mastercard want to control your wallet.


But:

DIY NFC using the Nexus S

Here's what we did next: Download the source (actually from CyanogenMod 7 to have the full build environment for the new Nexus S), make the appropriate changes to the code, recompile everything and put it back into the phone and it works — Nexus S supports card emulation and SWP!
Then we developed an Android app which we call "The Secure Element Manager" that gives the user full control over the secure elements in the phone as well as the NFC chip.
We are now able to fully control the PN65N from an Android app. Very nice, but not enough; we need more: an API for accessing the UICC (secure element) from an Android API.
nearfieldcommunicationsworld...................................................................................................
Luckily Giesecke & Devrient already supports the development of a smartcard stack for Android, SEEK, the Secure Element Evaluation Kit. This one is available for Android 2.2 and requires some adaption to work in Gingerbread, but after these changes we have a fully featured NFC phone using the Nexus S Hardware. Nice, isn't it?
aaa

http://groups.googlecom/group/android-developers/browse_thread/thread/418c9b370f08a9f7

__________________________________________________
Nokia C7 comes with a PN544 from NXP. .. ready for Single Wire Protocol support in order to use the UICC as the secure element.

.. Nokia only needs to provide firmware .. likely use NXP's FRI (Forum Reference Implementation), which is also used in the Google phone...
aaa

The FRI a basic software stack for managing the NFC chip through HCI (Host Controller Interface) Android's core and Symbian^3 are both implemented in C, so the stack ..can be ported to both ..

P2P/LLCP and card emulation using SWP or an embedded secure element.

On top of the FRI, Nokia will provide JSR257 (Java layer) in order to manage reading/writing functionality or exchanging of NDEF data structures. Depending on the configuration of the FRI, the phone can support SWP to offer card emulation using a UICC.

Nokia's C7 already provides JSR177 for J2ME applications to communicate with the UICC...
.......................
The Nexus S comes with a PN65N from NXP. This chip is a combination of the PN544 NFC controller and an embedded SmartMX secure element.
__________________________________________________



1. Is this the birth of a new payments network, or an old network in mobile form?

.. Google will be partnering with MasterCard to bring mobile payments ... If that turns out to be true, it's a definite win for the old guard. The current payments infrastructure is built on principles that were defined in the 1970s when credit cards as we know them appeared on the market. It's ripe for disruption and Google has the perfect skillset for doing so. Both MasterCard and Visa have looked at risk of disintermediation.

"secure element" in the case of the Google Nexus S, .. a chip embedded in the mobile phone during manufacturing. (Nexus has NO slot)
With a microSD, it can be anyone. With an embedded secure element, it would usually be the manufacturer of the phone. This is expected to be the case with RIM's forthcoming Blackberry NFC phones and is almost certain to be the case with a future Apple iPhone.
..........
Will any business be able to get access to Google mobile wallets — even direct competitors like Microsoft and Apple — or will Google lock them out? How about the likes of Groupon, PayPal, Facebook and Visa? And who will these businesses go to instead to access the new generation of mobile wallet technology if they can't access a Google Wallet?
nearfieldcommunicationsworld
__________________________________________________


The NXP PN65 .. the NFC radio controller, the embedded secure element and NFC software ...
nxp

Google Wallet, Google Offers, Google Prepaid Card and SingleTap, .. in conjunction with MasterCard, Citi, First Data and Sprint.
. add funds.. from any credit card.
Payments processing ..through MasterCard's PayPass network.
First Data for trusted service manager (TSM) ..such as provisioning card ..
..
nearfieldcommunicationsworld
hypercom

The Google Wallet limited to Nexus S 4G phones Sprint, not the 3G version for T-Mobile or other Android phones...
..Steve Owen, vice p id NXP ..all Android .. could potentially support the wallet
Google could try to control embedded chips and APIs, in other NFC phones ... at odds with mobile operators that want to control the application-bearing chips ..

Isis AT&T, Verizon Wireless and T-Mobile wants to control the secure elements Sprint dropped out.
nfctimes
European.. business model for NFC is based on charging fees to banks and other service providers to put their NFC applications on SIM cards that the telcos issue.

But Google, in fact, is also seeking to recruit European banks ..the Nexus S also supports the single-wire protocol connection to the SIM card, it's possible that Google could block this.

PayPal accusing Google of stealing its trade secrets by recruiting Osama Bedier Google's head of payments. also names Tilenius, who worked at eBay.

__________________________________________________

the wallet will require an “app-specific PIN” to activate, and in the first release (sic), “all payment card credentials will be encrypted and stored on a chip.” (like, in later releases card credentials will be scattered about in clear?]

Update: It's possible Google could ... use Andorid API availability to prohibit other wallet service providers? ..
Google made a point of saying that the wallet would be open to other banks and service providers, along with other mobile carriers and handset makers. ..Google is likely to want to control which applications go into its wallet, ..APIs and master keys, managed by First Data.

__________________________________________________