11 September 2011

Smart Card "No Driver Found", QR fun

 Smart Card "No Driver Found" - revisited - You can just ignore this message every time you read a card
OR the fix is: run
gpedit.msc
 1. Click Start, type gpedit.msc in the Search programs and files box, and then press ENTER.
2. In the console tree under Computer Configuration, click Administrative Templates.
3. In the details pane, double-click Windows Components, and then double-click Smart Card.
4. Right-click Turn on Smart Card Plug and Play service, and then click Edit.
5. Click Disabled, and then click OK.

 BUT Windows 7 Home Premium does NOT have gpedit (my New Laptop is W7HP)
 I looked for an install, but got a couple of dodgy looking sites that did NOT install gpedit.msc
I guess for now I'll just have to live with the annoying message

 These sites did NOT work: (remove the zzz if you really like dodgy web sites) icpezzzp thecustomizewzzzindows




This also does NOT work in Wind7HomePrem
 1. Run MMC.exe
 2. Add Group Policy snap-in
3. Open Local Computer Policy\Computer Configuration\Windows Settings\Administrative Templates\Windows Components\Smart Card
 4. Disable Turn On Smart Card Plug And Play Services. Smart Card "No Driver Found"


[im gonna hafta revert to old blog format... the new editor doesnt recognise linebreaks .. how braindead!]

_______________________________________________________________
Quickmark QR fun
 phone ctskinner phone
____________________________________________________________________
 Kronecker Blog Kronecker Blog _______________________________________________________________
 email ctskinner email _______________________________________________________________

Cheap NFC on the way nfctimes

06 September 2011

Java to CAP to Card

JCOP 


 Java to CAP
 Compiling the java:
 We use JCOP41 cards so: We need JavaCard old-style ie 2.2.1 and javaCompiler1.3

Eclipse uses 2.2.2+ so cant be used for the final compile.
 I suspect Netbeans might be persuaded to do the decent thing.

 You dont have to dig up java 1.3,       use java 1.6 with -target 1.1 -source 1.3

 here is the compile batch file
 ...........................................................

 copy "C:\Users\Chris Skinner\Documents\NetBeansProjects\Shamu\src\sham\Shamu.java" \card\src\sham


 set JC_HOME=C:\card\java_card_kit-2_2_1


 :: CARE set JAVA_HOME does NOT change javac version 


 set JAVA_HOME="C:\Program Files\Java\jre1.5.0_05"
:: the above line is pointless?? or does it give us api.jar??


 set PATH=.;%JC_HOME%\bin;%JAVA_HOME%\bin;%PATH%


 cd \card\src\sham
 del *.class


 ::C:\card\jsdk13\bin\javac -g -classpath ".;%JC_HOME%\lib\api.jar" Shamu.java  NOT NOW NEEDED


 javac -target 1.1 -source 1.3 -g -classpath ".;%JC_HOME%\lib\api.jar" Shamu.java 


 pause 


set _CLASSES=C:\card\java_card_kit-2_2_1\lib\apduio.jar;C:\card\java_card_kit-2_2_1\lib\api.jar;C:\card\java_card_kit-2_2_1\lib\capdump.jar;C:\card\java_card_kit- 2_2_1\lib\converter.jar;C:\card\java_card_kit-2_2_1\lib\offcardverifier.jar;




 cd \card\src\ 


 java -classpath "%_CLASSES%"      com.sun.javacard.converter.Converter -config Shamu.opt


 ...........................................................

 You cant just say "converter",
 I jumped through all the classpath hoops as above

 shamu.opt is a configuration file viz:
 ......................................................
 -out EXP JCA CAP
 -exportpath sham\exp 
 -applet 0x1:0x9:0x0:0x0:0x1:0x3:0x1:0x0:0x4:0x1 sham.Shamu sham 0x1:0x9:0x0:0x0:0x1:0x3:0x1:0x0:0x4 1.0

 ......................................................

 It is suggester that the package name should have at least 2 layers... ie I could use a few more...

 We dont ever use the EXP and JCA output?

__________________________________________________________________

CAP to Card

I have used jcManager source to write a CAPLoader

CAPLoader loads CAP produced by this method. (onto JCOP41 cars)

 It Doesnt load many sample CAPs that float down through the Internet.
I guess theyre mostly 2.2.2+

CAPLoader does use SCP02 (Secure Channel Protocol 02) so we are not entirely back in the dark ages. 

Oddly, It authenticates to old JCOP31 cards, so they can evidently use SCP02

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());