Simulator supports KeyPair.ALG_RSA?

I'm working on an javacard applet with rsa algorithm.
When I try to generate a keypair with the ALG_RSA, I always get an error (6F00).
I used KeyPair.genKeyPair to generate a pair of RSA keys with 1024-bits long.
When I tested applet source In Debug Mode, Simulator says the the source is not found in first line below.
     KeyPair = new KeyPair(KeyPair.ALG_RSA, (short)1024);
     KeyPair.genKeyPair();
But when I generate the keypair with ALG_RSA_CRT it works.
The important thing is that I'm testing with not Card but Simulator.
I'm working with Eclipse 3.2 with jcop plugin.
Any idea?
Jenny.
Edited by: JennyJPN on May 27, 2008 11:46 PM

JCOP does not support RSA plain, but only the CRT version.

Similar Messages

  • Does Flash Builder 4.5 simulator support software keyboard?

    Hi,
    I have a TextInput component in a mobile project and when simulating my application the software keyboard does not appear when I try to enter text.
    Does anyone know if the simulator supports the display of a software keyboard or do I have to run my application on a real device emulator to see it?
    thanks
    -Malena

    The Flash Builder simulator does not support the soft keyboard.  You will have to test functionality related to this on an actual device.

  • Does iOS Simulator Support StageVideo

    I've been looking thru the Adobe docs for info on this, but I've not found anything that? it seems that when my app is ran in the simulator, it reports that StageVideo capability is there, but the video never displays, I just hear audio. Once it did display, but the video flickered on/off. So can someone confirm if it is supposed to work on the simulator or not?
    thanks

    I can confirm that the StageVideo in the simulator does work without video, just audio - dependant on hardware setup. However if you can hear the video it means it will play on a device without problems.

  • [ANE] Repacking for simulator and fake support of device

    Hello,
    I have a question about anes, here is my problem : Some of the anes I use don't have simulator support or all-device support (only android, only iOS,...)
    In my code, I of course test the device before calling anything so its fine from a runtime point of view (never had a runtime issue).
    But, it does refuse to compile/launch. I know I could use multiple projects, compiler constants for imports, blablabla, but the best way to increase productivity would be to have them support all-device and simulator even if they do nothing with it.
    So what I tried :
    - rename ane as zip
    - edit extensions.xml, add proper stuff
    - rezip and rename back, and of course, don't call anything in the ane if you know your support is just "fake" for that device
    It works for simulator BUT if I use the rezipped ane in a iOS build (which was supported), it refuses to build a release. So I have to switch ane back and forth.
    It doesn't work if trying to add iOS support (well it compiles but when installing on device, install never ends). I tried adding a fake library.swf for iOS with only empty functions but didn't work.
    Haven't encountered the case where I need to add new Android support so I can't say for that one.
    Anyone knows of a quick way (which doesn't involve recreating all the concerned anes, since I don't have source code for them) ? Would create a huge productivity boost here.
    I hope question is clear enough.

    Understand that I'm not going to tell you that what you want is wrong. There's nothing wrong with wanting Flash on a tablet. The only problem is that the future of Flash no longer exists for tablets.
    fredfromewa wrote:
    So, does anyone know if real Java and Flash support is indeed coming in the future or am I going to have to either return or sell these IPADS and go switch a competitor...
    You can go to a competitor, but it won't help you in the long run since Adobe Flash on mobile is dead, and by the hand of Adobe themselves, not Apple. Here's the official announcement from 2 months ago:
    Adobe Abandons Mobile Flash, Backs HTML5
    You do have one alternative left: Buy a Windows-based tablet now. Why now? Because in mobile versions of Windows 8, Microsoft will no longer allow plug-ins like Flash:
    Microsoft Follows Apple, Bans Flash From Windows 8 Tablet Software
    In fact, even Microsoft's own Flash competitor, Silverlight, will not be allowed to run in tablet versions of Windows 8, only in desktop Windows.
    In the end, your last alternative will be to buy a Windows-based tablet that, ironically, does not run the tablet version of Windows, and then never upgrade it to Windows 8 mobile. You will probably be able to be run Flash then. But since the tablet will run desktop Windows, have fun with 30 minutes of battery life, maybe less after you boot Flash...
    fredfromewa wrote:
    ....they could easily have a much larger majority of the market with tablets by supporting Java and Flash.
    Uh...all the way up to now, the iPad practically has the entire tablet market to itself. How is it possible that Flash would have made that significantly larger?
    Seen from a different perspective...how is it that all the tablets that support Flash have completely failed to make a dent in the tablet market?
    Neither angle seems to support what you're saying.

  • Cycle accurate simulation - ModelSim Student & sbRIO

    Cycle accurate simulation support the current ModelSim PE Student Edition release is 10.0a?
    For project with sbRIO, can I use Cycle accurate simulation?
    Thanks in advance.

    NI Brazil Support answer:
    Some FPGA targets don´t support SIMULATION EXPORT including sbRIO. There isn´t a road map for new releases on LabVIEW with this extended feature .

  • RSA Keypair cannot be generated in javacard ?

    Hello
    I got a problem about how to generate a RSA keypair in JAVACARD, I tried many different parametres, but I cannot install my applet in my emulator.
    public class RSAencry extends Applet {
        RSAPrivateKey  rsa_PrivateKey;
        RSAPublicKey rsa_PublicKey;
        KeyPair rsa_KeyPair;
        Cipher cipherRSA;
        //private byte buffer[];
        //byte TheBuffer[];
        final short dataOffset = (short) ISO7816.OFFSET_CDATA;
        //constructor
        private RSAencry()
            //generate own rsa_keypair
             //rsa_KeyPair = new KeyPair( KeyPair.ALG_RSA_CRT, KeyBuilder.LENGTH_RSA_2048 );
             //super();
             try
             //TheBuffer = new byte[100];
             rsa_KeyPair = new KeyPair( KeyPair.ALG_RSA_CRT, KeyBuilder.LENGTH_RSA_512 );
             //rsa_PublicKey.setExponent (TheBuffer, (short)0, (short)1);
             rsa_KeyPair.genKeyPair();
            rsa_PublicKey = (RSAPublicKey) rsa_KeyPair.getPublic();
            //rsa_PrivateCrtKey = (RSAPrivateCrtKey) rsa_KeyPair.getPrivate();
            rsa_PrivateKey = (RSAPrivateKey) rsa_KeyPair.getPrivate();
            //buffer = new byte[2048];
            cipherRSA = Cipher.getInstance(Cipher.ALG_RSA_PKCS1, false);
             }catch (CryptoException ex){
                  ISOException.throwIt((short) (ex.getReason()));
            //register(bArray, (short) (bOffset), bArray[bOffset]);
         public static void install(byte[] bArray, short bOffset, byte bLength) {
              // GP-compliant JavaCard applet registration
              new RSAencry().register(bArray, (short) (bOffset + 1), bArray[bOffset]);
         public void process(APDU apdu) {
              // Good practice: Return 9000 on SELECT
              if (selectingApplet()) {
                   return;
              byte[] buf = apdu.getBuffer();
              switch (buf[ISO7816.OFFSET_INS]) {
              case (byte) 0x00:
                   break;
              default:
                   // good practice: If you don't know the INStruction, say so:
                   ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
    }The log shows as below:
    (2233 usec)
    <= 00 90 00 ...
    Status: No Error
    Load report:
    1358 bytes loaded in 0.0 seconds
    effective code size on card:
    + package AID 6
    + applet AIDs 15
    + classes 17
    + methods 138
    + statics 0
    + exports 0
    overall 176 bytes
    cm> install -i 525341656e637279 -q C9#() 525341656e63 525341656e637279
    => 80 E6 0C 00 1F 06 52 53 41 65 6E 63 08 52 53 41 ......RSAenc.RSA
    65 6E 63 72 79 08 52 53 41 65 6E 63 72 79 01 00 encry.RSAencry..
    02 C9 00 00 00 .....
    (122771 usec)
    <= 6A 80 j.
    Status: Wrong data
    jcshell: Error code: 6a80 (Wrong data)
    jcshell: Wrong response APDU: 6A80
    Unexpected error; aborting execution
    I almost removed all other codes, but it still can not intalled in card emulator.
    Does anyone can tell me that's why?
    Edited by: 949003 on 2012-8-3 上午8:05
    Edited by: 949003 on 2012-8-3 上午8:07

    Thanks Shane
    I even removed those senteces.
    public class RSAencry extends Applet {
        private KeyPair rsa_KeyPair;
        Cipher cipherRSA;
        //constructor
        private RSAencry()
             try
             new KeyPair( KeyPair.ALG_RSA, KeyBuilder.LENGTH_RSA_2048 );
             rsa_KeyPair.genKeyPair();
             }catch (CryptoException ex){
                  ISOException.throwIt((short) (ex.getReason()));
            //register(bArray, (short) (bOffset), bArray[bOffset]);
         public static void install(byte[] bArray, short bOffset, byte bLength) {
              // GP-compliant JavaCard applet registration
              new RSAencry().register(bArray, (short) (bOffset + 1), bArray[bOffset]);
         public void process(APDU apdu) {
              // Good practice: Return 9000 on SELECT
              if (selectingApplet()) {
                   return;
              byte[] buf = apdu.getBuffer();
              switch (buf[ISO7816.OFFSET_INS]) {
              case (byte) 0x00:
                   break;
              default:
                   // good practice: If you don't know the INStruction, say so:
                   ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
    }and I still got this log
    Status: No Error
    Load report:
    1089 bytes loaded in 0.0 seconds
    effective code size on card:
    + package AID 6
    + applet AIDs 15
    + classes 17
    + methods 101
    + statics 0
    + exports 0
    overall 139 bytes
    cm> install -i 525341656e637279 -q C9#() 525341656e63 525341656e637279
    => 80 E6 0C 00 1F 06 52 53 41 65 6E 63 08 52 53 41 ......RSAenc.RSA
    65 6E 63 72 79 08 52 53 41 65 6E 63 72 79 01 00 encry.RSAencry..
    02 C9 00 00 00 .....
    (7334 usec)
    <= 6A 80 j.
    Status: Wrong data
    jcshell: Error code: 6a80 (Wrong data)
    jcshell: Wrong response APDU: 6A80
    Unexpected error; aborting execution

  • Problem about javacard 2.2.1 simulator

    Hello,
    Does anyone know how to make the simulator support for RSA 1024 bits key length? I have tried to replace the lib file in javacard 2.2.1 to JCOP jc221 lib files, but the simulator works as the same as before, don't allow me to use 1024 bits key length in keyBuilder.
    Can the SATSA API for mobile connect to a real javacard? or JCOP simulator?
    I have tried to modify the JCOP simulator port number to 9025, but it doesn't work.
    Can anyone help me? Thanks a lot.

    Does anyone know how to make the simulator support
    for RSA 1024 bits key length? What do you use as "Simulator"? The JCWDE or CREF?
    I have tried to replace
    the lib file in javacard 2.2.1 to JCOP jc221 lib
    files, but the simulator works as the same as before,
    don't allow me to use 1024 bits key length in
    keyBuilder.If you are using cref - it can not work. There is AFAIK no cryptographic support in cref and you can not extend it. With JCWDE I don't have any experience.
    Can the SATSA API for mobile connect to a real
    javacard? or JCOP simulator?
    I have tried to modify the JCOP simulator port number
    to 9025, but it doesn't work.The JCOP-simulator are normally accessible via TCP/IP. The default port is localhost:8050
    Jan

  • KeyPair generation

    hi everyone
    my java card doesn't support KeyPair class.
    genKey method returns NO_SUCH_ALGORITHM exception.
    i want to generate keypair for RSA on card.
    is there any way for generatig keypair on card other than KeyPair class?
    thanks,
    siavash

    You're kidding, right? No smart card OS provider will give you the source code.
    If you want to know how key pair generation works, check some open source projects like bouncy castle or open SSL.

  • Having trouble with using crypto in JC 2.2.2

    Hi,
    I am using the sourceforge Eclipse plugin for my project. Eclipse version is 3.5.
    My JC version is 2.2.2. When i debug my code (Using the debug mode) the program terminates at
    keypair = new KeyPair(KeyPair.ALG_RSA_CRT, (short)1024);
    In the debug window (Variables) I get the cause and theSW as (0, 3) which i think implies CryptoException - NoSuchAlgorithm.
    I don't understand why this shows.
    It does not generate any stacktrace and shows stacktrace as null.
    My code:
    package test;
    import javacard.framework.APDU;
    import javacard.framework.Applet;
    import javacard.framework.ISO7816;
    import javacard.framework.ISOException;
    import javacard.security.*;
    //import javacardx.crypto.*;
    public class Test extends Applet {
    // Private Objects
    private static Key privateKey;
    public static Key publicKey;
    private static KeyPair keyPair;
    // Private Debug objects
    private byte flag = 0;
    //standard APDU input offset values
    public final static byte THIS_CLA = (byte)0x90;
    // This is the INS for starting to generate 1024 bit RSA keys
    public final static byte  GENERATE_RSA_KEYS = (byte)0x20;
    // INS to sign provided hash
    public final static byte  COMPLETE_TRANSACTION= (byte)0x22;
    // INS to return Status of Applet.
    public final static byte  INITIALIZE_UPDATE= (byte)0x24;
    // INS to reset keys
    public final static byte  COMPLETE_UPDATE= (byte)0x26;
    // dummy byte sequences returned by this applet
    private final static byte[] INIT_SEQUENCE = { (byte)0xff, (byte)0x2 };
    private final static byte[] COMPLETE_SEQUENCE = { (byte)0x1, (byte)0x3 };
    private final static byte[] INIT_UPDATE_SEQUENCE = { (byte)0x1, (byte)0x2, (byte)0x3 };
    private final static byte[] COMPLETE_UPDATE_SEQUENCE = { (byte)0x1, (byte)0x1 };
    * Constructor.
    * Only this class's install method can create the applet object.
    private Test() {
    //perform some initialization here
    register();//register this instance
    * Installs this applet.
    * @param byteArray the array containing installation parameters
    * @param offset the starting offset in byteArray
    * @param length the length in bytes of the parameter data in byteArray
    public static void install(byte[] byteArray, short offset, byte length) {
    new Test();
    * Implementation  of the standard method for processing an incoming APDU.
    * @param apdu the incoming APDU
    * @exception ISOException with ISO 7816-4 response bytes
    public void process(APDU apdu) {
    byte buffer[] = apdu.getBuffer();
    //@SuppressWarnings("unused")
    flag = 0;
    if (buffer[ISO7816.OFFSET_CLA] == THIS_CLA) {
    switch (buffer[ISO7816.OFFSET_INS])    {
    case GENERATE_RSA_KEYS:
    //writeBack(apdu, INIT_SEQUENCE);
    generateRSAKeys(apdu, INIT_SEQUENCE);
    flag = 1;
    break;
    case COMPLETE_TRANSACTION:
    writeBack(apdu, COMPLETE_SEQUENCE);
    break;
    case INITIALIZE_UPDATE:
    writeBack(apdu, INIT_UPDATE_SEQUENCE);
    break;
    case COMPLETE_UPDATE:
    writeBack(apdu, COMPLETE_UPDATE_SEQUENCE);
    break;
    default:
    ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
    * An example method that writes back a given byte array through the apdu.
    protected void generateRSAKeys(APDU apdu, byte[] bytes)  {
    //byte buffer[] = apdu.getBuffer();
    try {
    byte[] apduBuffer = apdu.getBuffer();
    // Debug flag
    flag = 9;
    //privateKey = KeyBuilder.buildKey(KeyBuilder.TYPE_RSA_PRIVATE,KeyBuilder.LENGTH_RSA_2048, false);
    //privateKey = KeyBuilder.buildKey(KeyBuilder.TYPE_DSA_PRIVATE,KeyBuilder.LENGTH_DES, false);
    //publicKey = KeyBuilder.buildKey(KeyBuilder.TYPE_RSA_PUBLIC,KeyBuilder.LENGTH_RSA_2048, false);
    // Debug flag
    flag = 10;   
    keyPair = new KeyPair(KeyPair.ALG_RSA_CRT, (short)1024);
    //keyPair = new KeyPair(KeyPair.ALG_RSA, (short)publicKey.getSize());
    keyPair.genKeyPair();
    publicKey = keyPair.getPublic();
    // Debug flag
    flag++;   
    ((RSAPublicKey)publicKey).getModulus(apduBuffer, (short)0);
    //    apdu.setOutgoing(); // set transmission to outgoing data
    //    apdu.setOutgoingLength((short) apduBuffer.length);
    apdu.setOutgoingAndSend((short) 0,  (short) (publicKey.getSize()/8));
    // Debug flag
    flag++;       
    } catch(Exception e) {
    flag = 0;
    * An example method that writes back a given byte array through the apdu.
    protected void writeBack(APDU apdu, byte[] bytes) {
    byte buffer[] = apdu.getBuffer();
    // copy bytes into buffer
    buffer[0] = bytes[0];
    buffer[1] = bytes[1];
    // set apdu for data output
    apdu.setOutgoing();
    apdu.setOutgoingLength( (short) (2) );
    // output header
    apdu.sendBytes( (short)0, (short) 2);
    // writes data
    //apdu.sendBytesLong( bytes, (short) 0, (short) 0 );
    } NOTE: Part of the code is from an online tutorial that i found.
    Thanks for your help.

    Hi,
    That exception generally means that the platform you are running on does not support that crypto operation. This can be an indecator that the cipher you would use this key with is not available or the key size you are using is not supported.
    I am not familiar with the Eclipse plugin you mentioned, but if you are using the Java implementation of the Java Card simulator (jcwde) provided with the JCDK, ti will not support crypto operations. There have been several posts on this topic recently that you may be able to search for that will give you more details about this.
    On a coding note, you should not be using the new keyword outside of the applet constructor. In fact you should not be allocating new memory outside of this constructor. This is because you should not rely on garbage collection in Java Card as it is not be implemented on all cards. If it is available on a card it may be rather slow.
    Cheers,
    Shane
    Edited by: safarmer on 27/10/2009 17:19

  • How can I use the security package in JCOP41V2.2?

    Hi all, I'm a newbie in javacard programming. I'm trying to develop a project with RSA_signature. But I found, the exception NO_SUCH_ALGORITHM will be thrown out when I new an instance of KeyPair.
    My java file Temp_1.java following:
    package temp;
    import javacard.framework.Applet;
    import javacard.framework.ISO7816;
    import javacard.framework.ISOException;
    import javacard.framework.APDU;
    import javacard.security.*;
    * @author lujj
    public class Temp_1 extends Applet {
    KeyPair myKeyPair = null;
         public static void install(byte[] bArray, short bOffset, byte bLength) {
              // GP-compliant JavaCard applet registration
              new Temp_1().register(bArray, (short) (bOffset + 1), bArray[bOffset]);
         public void process(APDU apdu) throws ISOException{
              // Good practice: Return 9000 on SELECT
              if (selectingApplet()) {
                   return;
              byte[] buf = apdu.getBuffer();
              if(buf[ISO7816.OFFSET_CLA] == (byte)0xEE)
                   try
                        myKeyPair = new KeyPair(KeyPair.ALG_RSA, KeyBuilder.LENGTH_RSA_1024);
                   catch(CryptoException e)
                        ISOException.throwIt((short)(0x6F00+e.getReason()));                    
                   return;
              switch (buf[ISO7816.OFFSET_INS]) {
              case (byte) 0x00:
                   break;
              default:
                   // good practice: If you don't know the INStruction, say so:
                   ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
    This package can be upload and the applet can be installed successfully.
    But if I send the apdu "EE 00 00 00 00" after selected the applet, "6F 03" will be returned.
    Is there anyone can help me? Thanks a lot.

    Thank you so much~
    Actually, it's only an applet for test. I cannot get the error code if I new the KeyPair in install function or Applet construct function. It will return "6A 80" when install the applet.
    And, I found that it support few algorithm. For example, it does not support ALG_DES_MAC4_ISO9797_M2,etc. Is there anything I can do if I want to use the algorithm? Shall I rewrite security package by myself?
    5555, security package is the standard package in JAVACARD API 2.1.1.

  • RMI client-side - how to encrypt,decrypt  in client-side

    I write javacard RMI style. My problem is...
    Source code below is work when it write in applet (card - side)
    but in client-side (reader -side) I copy it to client - side code and test to run, if fail --> throw exception 0x3 - javacard.security.CryptoException.NO_SUCH_ALGORITHM
    It seem to be "javacardx.crypto" and "javacard.security" is make for use in applet in card only. Did I misunderstand?
    if it make for use in applet only, how is possible to do like this " card use privatekey to sign message and send to reader , reader use card's publickey to verify that card sign this signature or not."
    or
    "card use reader's publickey to encrypt message and send to reader, then reader use privatekey to decrypt message (reader authencate itself) "
    because I can't do any of cipher , keybuilder in RMI-client side(reader)
    Cipher.getInstance(Cipher.ALG_RSA_PKCS1,false);
    it will throw nullPointerException
    and if (change false to true)
    Cipher.getInstance(Cipher.ALG_RSA_PKCS1,true);
    throw exception 0x3 - javacard.security.CryptoException.NO_SUCH_ALGORITHM
    after that I swap this line with
    pri_key = (RSAPrivateKey) KeyBuilder.buildKey(KeyBuilder.TYPE_RSA_PRIVATE,KeyBuilder.LENGTH_RSA_512, false);
    since it will do this first (i swap the line already) it also throw exception 0x3 - javacard.security.CryptoException.NO_SUCH_ALGORITHM
    also be the same result with swap
    kp = new KeyPair(KeyPair.ALG_RSA,(short)KeyBuilder.LENGTH_RSA_512 );
    to a first line
    it throw exception 0x3 - javacard.security.CryptoException.NO_SUCH_ALGORITHM
    Please help me
    RSAPrivateKey pri_key;
    RSAPublicKey pub_key;
    KeyPair kp;
    Cipher RSAcipher;
    RSAcipher = Cipher.getInstance(Cipher.ALG_RSA_PKCS1,false);
    pri_key = (RSAPrivateKey) KeyBuilder.buildKey(KeyBuilder.TYPE_RSA_PRIVATE,KeyBuilder.LENGTH_RSA_512, false);
    pub_key =(RSAPublicKey) KeyBuilder.buildKey(KeyBuilder.TYPE_RSA_PUBLIC,KeyBuilder.LENGTH_RSA_512, false);
    kp = new KeyPair(KeyPair.ALG_RSA,(short)KeyBuilder.LENGTH_RSA_512 );
    kp.genKeyPair();
              pri_key = (RSAPrivateKey) kp.getPrivate();
              pub_key = (RSAPublicKey) kp.getPublic();
    //ENCRYPT
    RSAcipher.init(pri_key, Cipher.MODE_ENCRYPT);
    t_cipherLengthRSA = RSAcipher.doFinal(plaintxt,(short)0, (short)plaintxt.length, t_cipherText, (short)0);
    //DECRYPT
    RSAcipher.init(pub_key, Cipher.MODE_DECRYPT);
    RSAcipher.doFinal(ciphertxt,(short)0,(short) t_cipherLengthRSA, temp1, (short)0);

    I write javacard RMI style. My problem is...
    Source code below is work when it write in applet (card - side)
    but in client-side (reader -side) I copy it to client - side code and test to run, if fail --> throw
    exception 0x3 - javacard.security.CryptoException.NO_SUCH_ALGORITHMYou can not share code between card and client. On the card use the classes of javacardx.crypto and on the client side those of javax.crypto and java.security.
    It seem to be "javacardx.crypto" and "javacard.security" is make for use in applet in card only. That is right.
    if it make for use in applet only, how is possible to
    do like this " card use privatekey to sign message
    and send to reader , reader use card's publickey to
    verify that card sign this signature or not." or
    "card use reader's publickey to encrypt message and
    send to reader, then reader use privatekey to decrypt
    message (reader authencate itself) "On each platform you have classes that provide the same cryptographic operations but the interface of these classes is different (because of the limitations of the java card platform).
    because I can't do any of cipher , keybuilder in
    RMI-client side(reader)Use the java.security.KeyFactory instead.
    Cipher.getInstance(Cipher.ALG_RSA_PKCS1,false);
    it will throw nullPointerException
    and if (change false to true)
    Cipher.getInstance(Cipher.ALG_RSA_PKCS1,true);
    throw exception 0x3 -
    javacard.security.CryptoException.NO_SUCH_ALGORITHMCryptographic support on java cards is optional. Not every card supports every algorithm. Try to use another algo.
    Jan

  • Bold 9650 is the WORST phone I have ever had!!! :-(

    OK... I "upgraded" my phone to the Bold 9650 when it just came out earlier this year, wanting the latest and greatest. I have been an extremely loyal BlackBerry user for more than a decade. In fact, one BlackBerry I had a while back went a year-and-a-half without crashing, freezing, nor giving me any trouble whatsoever. Now, unfortunately, with my bold 9650, I'm lucky of I can go an HOUR-and-a-half without some sort of freeze or crash, and often the only way to get back on track is to pull the battery and restart. Several. Times. Each. Day. And I get REALLY tired of seeing the spinning icon showing me that BlackBery is doing something on its own, but I cannot do a thing with it. Can't move the thumbwheel. Can't enter any text. Can't even shut the phone off!!!
    Am I alone, or are others out there experiencing the same problems? I'm about to abandon the Bold 9650 and get something else. What is a good replacedment for it?
    Thank you.

    OEMMaster wrote:
    OK... I "upgraded" my phone to the Bold 9650 when it just came out earlier this year, wanting the latest and greatest. I have been an extremely loyal BlackBerry user for more than a decade. In fact, one BlackBerry I had a while back went a year-and-a-half without crashing, freezing, nor giving me any trouble whatsoever. Now, unfortunately, with my bold 9650, I'm lucky of I can go an HOUR-and-a-half without some sort of freeze or crash, and often the only way to get back on track is to pull the battery and restart. Several. Times. Each. Day. And I get REALLY tired of seeing the spinning icon showing me that BlackBery is doing something on its own, but I cannot do a thing with it. Can't move the thumbwheel. Can't enter any text. Can't even shut the phone off!!!
    Am I alone, or are others out there experiencing the same problems? I'm about to abandon the Bold 9650 and get something else. What is a good replacedment for it?
    Thank you.
    Thanks to SuzyQ for your input. Hi OEMMaster, How much memory is on your device? It could be low memory causing your device to freeze. Please try cleaning the memory to free up some space and resources. If your memory cleaning feature is not turned, please use the steps below to enable this feature with helping to avoid low memory.  I'm providing steps below for turning this feature along with a link to our website to the user manual and simulator supporting your device. If you have tried these suggestion and still have the issues, I could look into an option of offering you a certified like new replacement if you are under warranty. Please send me a private message with your information to be assisted further. I hope this helps.
    To turn on the memory cleaning feature:
    1. On the Home screen or in a folder, click the Options icon.
    2. Click Security > Advanced Security Settings > Memory Cleaning.
    3. Select the Enable check box.
    4. Press the key > Save.

  • Rsa Decrypt Not Working.. Please Help

    Hi everyone,
         I am new to java card development. I have been trying to use RSA encryption in my Applet. I finally got the encryption working but the decryption is showing Illegal Use Error. Any kind of help is appreciated.
    public class RSAsample extends Applet{
    byte[] rsaPublic = new byte[4];
    byte[] rsaPrivate = new byte[4];
    byte[] rsaPublicMod = new byte[4];
    RSAPrivateKey pri ;
    RSAPublicKey pub ;
    private final static byte INS_ENCRYPT = (byte) 0x20;
    private final static byte INS_DECRYPT = (byte) 0x30;
    KeyPair pair ;
    private RSAsample() {
      super();
      register();
    public static void install(byte bArray[], short bOffset, byte bLength)
      throws ISOException {
      new RSAsample();
    public boolean select() {
      pair = new KeyPair(KeyPair.ALG_RSA, (short) 512);
      pair.genKeyPair();
    pri = (RSAPrivateKey) pair.getPrivate();
    pub = (RSAPublicKey) pair.getPublic();
      return super.select();
    public void deselect() {
      super.deselect();
       public void process(APDU apdu) throws ISOException {
        byte[] buffer = apdu.getBuffer();
        switch(buffer[ISO7816.OFFSET_INS])
        case INS_ENCRYPT:
        encrypt(apdu);
        break;
        case INS_DECRYPT:
        decrypt(apdu);
        break;
    private void decrypt(APDU apdu) {
      byte[] buffer = apdu.getBuffer();
      byte byteRead = (byte)(apdu.setIncomingAndReceive());
      short size = 0;
      try{
      Cipher cipher = Cipher.getInstance(Cipher.ALG_RSA_PKCS1, false);
      cipher.init(pri, Cipher.MODE_DECRYPT);
      size =  cipher.doFinal(buffer, ISO7816.OFFSET_CDATA, (short)byteRead, buffer,
      (short) 0);
      catch(CryptoException e)
      switch(e.getReason())
      case CryptoException.ILLEGAL_USE:
      ISOException.throwIt(ISO7816.SW_DATA_INVALID);
      break;
      case CryptoException.ILLEGAL_VALUE:
      ISOException.throwIt(ISO7816.SW_FILE_INVALID);
      break;
      case CryptoException.INVALID_INIT:
      ISOException.throwIt(ISO7816.SW_FILE_NOT_FOUND);
      break;
      case CryptoException.NO_SUCH_ALGORITHM:
      ISOException.throwIt(ISO7816.SW_FILE_INVALID);
      break;
      case CryptoException.UNINITIALIZED_KEY:
      ISOException.throwIt(ISO7816.SW_FILE_FULL);
      break;
      default:
      ISOException.throwIt(ISO7816.SW_FUNC_NOT_SUPPORTED);
      break;
      apdu.setOutgoing();
      apdu.setOutgoingLength(size);
      apdu.sendBytes((short)0, size);
    private void encrypt(APDU apdu) {
      byte[] buffer = apdu.getBuffer();
      byte byteRead = (byte)(apdu.setIncomingAndReceive());
      short size = 0;
      try{
      Cipher cipher = Cipher.getInstance(Cipher.ALG_RSA_PKCS1, false);
      cipher.init(pub, Cipher.MODE_ENCRYPT);
      size =  cipher.doFinal(buffer, ISO7816.OFFSET_CDATA, (short)byteRead, buffer,
      (short) 0);
      catch(CryptoException e)
      switch(e.getReason())
      case CryptoException.ILLEGAL_USE:
      ISOException.throwIt(ISO7816.SW_DATA_INVALID);
      break;
      case CryptoException.ILLEGAL_VALUE:
      ISOException.throwIt(ISO7816.SW_FILE_INVALID);
      break;
      case CryptoException.INVALID_INIT:
      ISOException.throwIt(ISO7816.SW_FILE_NOT_FOUND);
      break;
      case CryptoException.NO_SUCH_ALGORITHM:
      ISOException.throwIt(ISO7816.SW_FILE_INVALID);
      break;
      case CryptoException.UNINITIALIZED_KEY:
      ISOException.throwIt(ISO7816.SW_FILE_FULL);
      break;
      default:
      ISOException.throwIt(ISO7816.SW_FUNC_NOT_SUPPORTED);
      break;
      apdu.setOutgoing();
      apdu.setOutgoingLength(size);
      apdu.sendBytes((short)0, size);
    Also if this is wrong can you share a sample code using RSA Encryption and Decryption.
    Thanks

    Hi,
    You code looks perfectly fine.
    Looking at the error code i think you are sending some invalid data for decryption operation.
    You should send data which was encrypted using the same PublicKey other wise it will fail while matching the Padding or Data Blocks.
    For better understanding Encrypt some data and immediately use the output data for Decrypt operation and it should work fine.
    Let me know if you face any difficulties.
    BR,
    PPT

  • RSA and Cyberflex

    hi,
    Someone know if there is some problem with RSA and the card "Cyberflex 64 ko"? because when I try to use RSA 1024 bit with this card, it return 6F00.
    I think the problem is on this line:
    KeyPair pairDeCle = new KeyPair(KeyPair.ALG_RSA, KeyBuilder.LENGTH_RSA_1024);The same applet, (same .cap) works with my other card. (In the card specification they say we can use the card with RSA 1024 or 2048 bit)
    regards
    nico

    my applet: (it is the same code of the post "RSA && contactless" with try/catch in addition)
    package fr.moneo_RSA_Biometrie;
    import org.javacardforum.javacard.biometry.SharedBioTemplate;
    //import fr.alex.biometry.SharedBioTemplate;
    import javacard.framework.AID;
    import javacard.framework.APDU;
    import javacard.framework.Applet;
    import javacard.framework.ISOException;
    import javacard.framework.ISO7816;
    import javacard.framework.JCSystem;
    import javacard.framework.OwnerPIN;
    import javacard.security.DESKey;
    import javacard.security.CryptoException;
    import javacard.security.KeyBuilder;
    import javacard.security.KeyPair;
    import javacard.security.RSAPrivateKey;
    import javacard.security.RSAPublicKey;
    import javacardx.crypto.Cipher;
         public class Application_moneo_RSA_biometrie extends Applet {
                final byte CLA_MONAPPLET = (byte) 0xB0;
                final byte INS_INCREMENTER_COMPTEUR = 0x00;
                final byte INS_DECREMENTER_COMPTEUR = 0x01;
                final byte INS_INTERROGER_COMPTEUR = 0x02;
                final byte INS_INITIALISER_COMPTEUR = 0x03;
                final byte INS_SAISIR_CODE = 0x04;
                final byte INS_CRYPTO = 0x05;
                final byte INS_INIT = 0x06;
                private boolean flagCrypto = false;      
                Cipher ecipher;
                   private DESKey key;
                   KeyPair pairDeCle;
                public OwnerPIN pin;
                private byte[] pinBon = {0x31,0x30,0x30,0x30};           
                private RSAPublicKey clePublic;
                private RSAPrivateKey clePrive;
                private byte[] Crypto;
                private byte compteur;           
                       private AID bioServerAID;
                       SharedBioTemplate bioImpl;
                       private static final byte[] BIO_SERVER_AID = {(byte)0x01, (byte)0x02, (byte)0x03,(byte)0x04, (byte)0x05, (byte)0x06,(byte)0x07, (byte)0x08, (byte)0x07,(byte)0x06, (byte)0x05, (byte)0x04};
              public Application_moneo_RSA_biometrie() {
                   compteur = 5;
                   pin = new OwnerPIN((byte)2, (byte)4);          
                   pin.update(pinBon, (short)0, (byte)4);
              public static void install(byte bArray[], short bOffset, byte bLength)
                   throws ISOException {
                   new Application_moneo_RSA_biometrie().register();
              public void process(APDU apdu) throws ISOException {
                   byte[] buffer = apdu.getBuffer();
                   if (this.selectingApplet()){
                        initialisation();     
                           bioServerAID = JCSystem.lookupAID(BIO_SERVER_AID,(short)0,(byte)BIO_SERVER_AID.length);               
                                    bioImpl = (SharedBioTemplate) JCSystem.getAppletShareableInterfaceObject(bioServerAID,(byte)0);                                         
                                    apdu.setOutgoing();
                        apdu.setOutgoingLength((short)Crypto.length);
                        apdu.sendBytesLong(Crypto,(short) 0, (short) Crypto.length);
                            return;
                   if (buffer[ISO7816.OFFSET_CLA] != CLA_MONAPPLET) {
                        ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);
                   switch (buffer[ISO7816.OFFSET_INS]) {
                   case INS_INIT:
                        break;
                   case INS_SAISIR_CODE:
                        byte byteRead = (byte) apdu.setIncomingAndReceive();
                        byte[] partieAdecrypter = RecupererPartieDeAPDU(apdu.getBuffer(), (short)5, (short)byteRead);          
                        byte[] derypt = decrypter(partieAdecrypter);
                        short u =0;
                        for(short i = 5; i<9; i++){
                        buffer[i] = derypt[u];
                        u++;
                        short result = bioImpl.match(buffer,(short) 5, (short) 4);
                        if (!bioImpl.isValidated()){
                             ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);
                        break;
                   case INS_INCREMENTER_COMPTEUR:
                             if (bioImpl.isValidated())
                             compteur++;
                             else {
                                  ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);
                             break;
                   case INS_DECREMENTER_COMPTEUR:
                             if (bioImpl.isValidated())
                             compteur--;
                             else {
                                  ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);
                             break;
                   case INS_INTERROGER_COMPTEUR:
                             if (bioImpl.isValidated()){
                             byte[] valeur = new byte [2];
                             valeur[0] = compteur;
                             apdu.setOutgoing();
                             apdu.setOutgoingLength((short)valeur.length);
                             apdu.sendBytesLong(valeur,(short) 0, (short) valeur.length);                    
                             }else {
                                  ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);
                             break;
                   case INS_INITIALISER_COMPTEUR:
                             if (bioImpl.isValidated())
                             apdu.setIncomingAndReceive();
                             compteur = buffer[ISO7816.OFFSET_CDATA];
                             else {
                                  ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);
                             break;
                   default:
                             ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
              public byte[] RecupererPartieDeAPDU(byte[] tableauReference, short offset, short length){
                   byte[] copieTableau = new byte[length];
                   short u =0;
                   for (short i= offset; i<(short)(offset+length); i++){
                        copieTableau[u]=tableauReference;
                        u = (short)(u + 1);
                   return copieTableau;     
         public void initialisation(){
              try{
              pairDeCle = new KeyPair(KeyPair.ALG_RSA, KeyBuilder.LENGTH_RSA_1024);
              } catch (CryptoException e){
                   ISOException.throwIt((short) e.ILLEGAL_USE);
                   ISOException.throwIt((short) e.ILLEGAL_VALUE);
                   ISOException.throwIt((short) e.INVALID_INIT);
                   ISOException.throwIt((short) e.NO_SUCH_ALGORITHM);
                   ISOException.throwIt((short) e.UNINITIALIZED_KEY);
              } catch (Exception e){
                   ISOException.throwIt((short)4000);
              pairDeCle.genKeyPair();
              clePublic = (RSAPublicKey) pairDeCle.getPublic();
              clePrive = (RSAPrivateKey) pairDeCle.getPrivate();
              byte[] buffer1 = new byte[1024];
              short tailleExponent = clePublic.getExponent(buffer1, (short)0);
              byte[] exponent = new byte[tailleExponent];
              clePublic.getExponent(exponent, (short)0);
              byte[] buffer2 = new byte[512];
              short tailleModulus = clePublic.getModulus(buffer2, (short)0);
              byte[] modulus = new byte[tailleModulus];
              clePublic.getModulus(modulus, (short)0);
              byte[] positif = new byte[1];
              positif[0] = (byte)0x00;
              byte[] moduluspositif = concatener(positif, modulus, (short)0, (short)modulus.length);
              byte[] sizeExp = new byte[1];
              byte[] sizemodulus = new byte[1];
              sizeExp[0] = (byte)exponent.length;
              sizemodulus[0] = (byte)moduluspositif.length;
              byte[] tailleAndExp = concatener(sizeExp, exponent, (short)0, (short)exponent.length);
              byte[] tailleAndmodulus = concatener(sizemodulus, moduluspositif, (short)0, (short)moduluspositif.length);
              Crypto = concatener(tailleAndExp, tailleAndmodulus, (short)0, (short)tailleAndmodulus.length);
         public byte[] concatener(byte[] tableRef, byte[] tabACopier, short offset, short lenght){
              byte [] newTab = new byte[(short)(tableRef.length + lenght)];
              for(short o = 0; o < (short)tableRef.length; o++){
                   newTab[o] = tableRef[o];
              short u = 0;
              for(short i = (short) tableRef.length; i < (short)(tableRef.length + lenght); i++){               
                   newTab[i] = tabACopier;
                   u = (short)(u + 1 + offset);
              return newTab;          
         public byte[] recuperDonnee(APDU apdu){
              byte[] buf = apdu.getBuffer();
              short lc = apdu.setIncomingAndReceive();
              byte[] data = new byte[lc];
              short u =0;
              for(short i = 5; i<(short)(5+lc);i++){
                   data[u] = buf;
                   u = (short) (u+1);     
              return data;
         public byte[] decrypter(byte[] data ){
              Cipher cipher = Cipher.getInstance(Cipher.ALG_RSA_PKCS1, false);
              cipher.init(clePrive,Cipher.MODE_DECRYPT);     
              byte[] donneDecrypt = new byte[(short)data.length];
              cipher.doFinal(data, (short)0, (short)data.length, donneDecrypt, (short)0);
              return donneDecrypt;

  • 6/8/2012 - AIR 3.3 Release Announcement

    Today we're pleased to announce that the next version of AIR, 3.3.0.3650, is available for immediate download.  This update includes the following new features:
    USB debugging for AIR iOS — This new feature allows the iOS developer to connect to the desktop via USB while debugging their mobile applications instead of relying on network connectivity.
    Enhanced Background behavior for AIR iOS — Background support now more closely resembles native applications in iOS. In addition to some basic multitasking and background audio support that is already enabled with AIR for iOS, applications may now support location updates and networking in the background, as well as being notified when a background app is about to be suspended by the operating system.
    Stylus support for Android 4.0 — Stylus support in Flash takes advantage of the new-in-4.0 Android Stylus API, so that stylus-aware apps work automatically with any devices supporting the Android API set.
    Simulator Support (Mac) — With the enhanced simulator support a developer can now package and run an application on iOS simulator using ADT commands. This feature allows an iOS developer to develop and run an application without needing an actual set of devices by using the iOS simulator using Xcode.
    Aspect Ratio Enhancements — With AIR 3.3 the issue with the runtime ignoring the specified aspect ratio has been resolved. In this release we address this use-case by allowing only screen orientation corresponding to app specified aspectRatio and orientation corresponding to 180 degree device rotation from the specified aspectRatio.
    Improved Mac App Store Support — Added support to ensure Mac AIR apps adhere to Apple guidelines and can be submitted to the Mac App store successfully.
    AIR 3.3 runtime for Windows and Macintosh: 3.3 Download
    AIR SDK 3.3 for Windows and Macintosh: 3.3 Download
    Previous versions of the AIR runtime and SDK can be found on the Archived AIR SDK and Runtimes page
    For further additional information please see our Runtime release notes and Developer release notes

    Why is it impossible to find the IOS sdk 6.0 on adobe site or any related forum ? i searched everywhere the only place i found it was on developer apple in a DMG i needed to uncompress to see that it was in a format not reable by windows. as i understand the only way to get it is by installing xcode on a mac and copying it from here. Why adobe not giving it ? or updating the 3.4 sdk with 6.0 in it ?
    I mean... with air 3.4 you can use platformsdk.. and you can use it on windows!! BUT NOBODY GIVE THE SDK!! Go on google and i dare you to find sdk 6.0 in a format readable for windows!
    anyway i used the beta 3.5 for now i just found that sad that the support for such a obvious request isn't met.

Maybe you are looking for

  • RegisterHotKey(....) to disable hotkeys such as ALT+F4 is not working in C# Web Browser control

    Disabling hot keys like "ALT+F4" using register RegisterHotKey(..) function and wndproc(..) function in c# windows application is not working as expected in few cases. Below is the description. I am using C# Web Browser control in windows application

  • IOS 15 not working with my TACACS server

    Hi All, I recently made some changes to the way my Tacacs server (ACS4.2) handled groups etc.. This all works fine and when I log onto my devices I get prompted for my credentials, which authenticate against AD. However, since I made these changes no

  • SMTPD consumes all available RAM resources

    Hi all, I have a mail server that has extremely heavy disk activity after a few minutes of being booted, I have narrowed this down to heavy RAM usage by the SMTPD process. In Activity monitor, multiple SMTPD processes are spawned, consuming up to 2GB

  • Customer Credit Memo for Allowance

    Hi Guys, This is my client senario: My Client would like to be able take allowances off invoice for Koreian Customer a sold to account.  They are regulated by their bank against taking deductions on invoices, so they would have to pay invoices in ful

  • Everytime I try to download and instal most recent firefox, installer freezes

    I keep getting a pop up saying that a new version of firefox is available, i click ok to download and install and the status freezes and never completes, so I have to forcequit. I have an imac OZx10.7.1 and am currently using firefox 6.0.1