Elliptic curve encryption with J2ME

hi there.
i'm using the bouncycastle apis to encrypt a small amount of data (e.g. 20 chars) using ECIES. All the documentation seems to point to ECC as being faster/requiring shorter keys/less power-hungry etc than RSA, however, with the example code I have, the encryption time on a high end mobile is ridiculous.
I'm thinking that the example G, n, a, b, and Q are for larger key sizes. Does anyone know how I can generate these values for a 160b ECC key, or a good bouncycastle/j2me ECC tutorial/sample code?
Thanks in advance.
caid

No Sun provider implements the EC algorithms at this time.
Here's an easy solution that works (Using NSS):
http://blogs.sun.com/andreas/entry/elliptic_curve_cryptography_in_java
NSS has been recently FIPS re-approved.
BouncyCastle is another option if FIPS doesn't matter to you at all and you want pure java.
Edited by: dstutz on Mar 10, 2008 7:49 AM

Similar Messages

  • How to use elliptic curve encryption?

    Hi, are there any examples?
    I tried to get a key generator using KeyPairGenerator.getInstance("EC") but failed.
    And I also cannot get a cipher using Cipher.getInstance("EC").
    Thanks.

    No Sun provider implements the EC algorithms at this time.
    Here's an easy solution that works (Using NSS):
    http://blogs.sun.com/andreas/entry/elliptic_curve_cryptography_in_java
    NSS has been recently FIPS re-approved.
    BouncyCastle is another option if FIPS doesn't matter to you at all and you want pure java.
    Edited by: dstutz on Mar 10, 2008 7:49 AM

  • Elliptic Curve

    Hi to all, i'm an italian student and i must implements the BLS signature scheme in Java. BLS work on elliptic curve over finite field F3^m. I've seen elliptic curve in Java but over finite field F2^m. The question is: how i can do? Excuse me for my english and if something that i've write is wrong.
    Thanks to all.

    Hi,
    Firstly, please check if your card supports EC cryptography. You can find this information in product data sheet or ask the card manufacturer.
    I'm not sure if you can perform data encryption or decrytpion with ECC on JC. It is rather dedicated to sign/verify operation. Please find below modification of your sample code with sign and verify example.
            byte[] dataToSend = new byte[64];
            KeyPair ecKeyPair = new KeyPair(KeyPair.ALG_EC_FP, KeyBuilder.LENGTH_EC_FP_128);
            ecKeyPair.genKeyPair();
            ECPrivateKey ecPrivateKey = (ECPrivateKey) ecKeyPair.getPrivate();
            ECPublicKey ecPublicKey = (ECPublicKey) ecKeyPair.getPublic();
            Signature sig = Signature.getInstance(Signature.ALG_ECDSA_SHA, false);
            sig.init(ecPrivateKey, Signature.MODE_SIGN);
            short resLen = sig.sign(new byte[]{0,1,2,3}, (short)0, (short)4, dataToSend, (short)0);
            sig.init(ecPublicKey, Signature.MODE_VERIFY);
            if (!sig.verify(new byte[]{0,1,2,3}, (short)0, (short)4, dataToSend, (short)0, resLen))
                ISOException.throwIt(ISO7816.SW_WRONG_DATA);
    Regards

  • Java Card and Elliptic Curves

    Hi all,
    has anyone ever used Elliptic Curve cryptography on a Java Card? I can't find any documentation and sample code about this topic, although it should be implemented in the new java card specifications.
    I would like to use ECC instead of RSA for encrypting a message and verifying a signature on a java card with a EC pubkey.
    If anyone could provide me with sample code or hints, that would be very helpful!
    Thanks in advance,
    Matthias

    has anyone ever used Elliptic Curve cryptography on a
    Java Card? I can't find any documentation and sample
    code about this topic, although it should be
    implemented in the new java card specifications.No, it can (not should) be implemented. The implementation of all cryptographic algorithms is optional.
    I would like to use ECC instead of RSA for encrypting
    a message and verifying a signature on a java card
    with a EC pubkey.
    If anyone could provide me with sample code or hints,
    that would be very helpful!The sample code wouldn't be too complicated to create (should be very similar to using RSA) but where do you execute this code? All emulators/simulators and the real Java Cards I know do not support ECC.
    I only heard rumours that "Trusted Logic" has Java Cards which support ECC, but I haven't checked that.
    Jan

  • Elliptic curve coprocessor in JCOP

    I have some JCOP41/72K cards with support to ECC.
    I suppose the cards come with a coprocessor that performs the elliptic curve operations in binary fields, like reduction modulo irreducible polynomial and escalar multiplication of a point.
    I've already developed a signature scheme (ECDSA) in these cards using Java Card API.
    In ECDSA, the card performs all elliptic curve operations and gives the result.
    These operations are perfomed by the coprocessor in a transparent way when I ask to compute a ECDSA signature.
    Now I would like to develop other cryptosystems based on bilinear pairings.
    So I need to perform operations like reduction modulo irreducible polynomial and escalar multiplication of a point.
    Does anybody know if its possible to access the functionalities of the elliptic curve coprocessor of JCOP cards?
    If its possible, how can I do this?
    Thanks.

    Ok. Thanks for your reply.
    Please, could you answer the following questions or
    indicate where can I find the answers?
    - Is there a software like JCOP Tools to work with
    pure SmartMX cards? Is it free? No. You need to order pure SmartMX including the Crypto Lib from NXP directly .. best is you contact their product manager to find out the details and tools support.
    - Besides the card reader that I use to work with the
    MPCOS/GPK/GemXpresso/JCOP cards, is it necessary any
    other hardware?Probably an emulator.
    - Which programming language is used to program these
    cards? C and assembler.

  • Help: Encrypt with the SATSA library

    Hi,
    I would like to encrypt a stream with the SATSA library using the Rijndael (AES) Algorithm. The length of the plain text is not fixed. Then I need to specify the padding mode... The problem is that the decrypt method is written with VB.Net and the accepted paddings are "Zeros" and "PKCS7" using methods Rijndeal or DES ! If I choose the "NoPadding" method, I get a BadPaddingException or a IllegalBlocksizeException.
    Is there a way to write a compatible fonction with J2ME ? Thank you for your help...
    FD

    I can give you an example to illustrate the problem explained before:
    If I encrypt a fixed plain text (8 bytes) with a DES key (8 bytes), the "ECB" mode without padding, it works very well. But if I run the same method to a text with a variable size, I get an IllegalBlockSizeException !
    Is there a way to put a "Zeros" padding in J2ME ? Tanks...
    FD

  • How to update "Encrypt with UserKey" after Windows User Profile replacement?

    A problem with my User Profile required that the files be backed up, the profile deleted, a new profile created and my files restored. I have several SSIS projects built in Visual Studio 2012 that use "EncryptSensitiveWithUserKey". I assume the
    "UserKey" is based on the SID or GUID of my User Profile. Now when I open these projects I get the Warning:
    Warning 2 Warning loading SSISProject.dtproj: Warning: Failed to decrypt sensitive data in project with a user key. You may not be the user who encrypted this project, or you are not using the same machine that was used to save the project. If the sensitive data is a parameter value, the value may be required to run the package on the Integration Services server. SSISProject.dtproj 0 0
    Is there a way to reset the UserKey in an existing project to the key for my new Profile? Is the value derived and used for encryption stored in the .dtproj file? If so can I copy that value from a new SSIS project into the .dtproj file for my old projects?
    There has to be some way to "transfer ownership" of an SSIS project.
     

    There has to be some way to transfer "ownership" of SSIS projects between developers. Forget about my specific case of my profile being recreated. Let's say I built this SSIS project and was required to use Encrypt with UserKey. I leave
    the company. They ask another developer to make changes to the project. My old "ownership" of the project should be somehow transferable to the new developer. It shouldn't be tied to my ID (which no longer exists at the company) in perpetuity. Microsoft
    has to have some way to transfer "ownership" of SSIS Projects with "Encrypt with UserKey". It's such a common use case I can't believe they wouldn't provide for it.
    No, there is no way . This option is the default and it is actually the worst option precisely because it is useless in team development environment. Use
    EncryptSensitiveWithPassword option just like Arthur suggested and you should be fine.
    SSIS Tasks Components Scripts Services | http://www.cozyroc.com/

  • Where can I find a good tutorial for mobile game developement with J2ME ?

    Hi All,
    I'm completely new to J2ME programming. But I have past experience on J2SE developement. Now I would like to know that where can I find a good tutorial for mobile game developement with J2ME ?
    I'll be very greatful if I can find a useful step-by-step tutorial (eg. "The Java Tutorial" for J2SE)
    Please point me ot the direction.
    Thanks
    ZuriJAckshoT

    ibook-widgets.com    have a free tutorial book in the iBooks store.  Search for "Create your first interactive book using iBooks Author"   they also  sell widgets.
    I  dont have any connection - I  found their eBook in the store long ago  and used it to learn more about iBA.
    The best advice though, is be patient,  go back over the process step by step, I cannot  access the Help files for some reason.. but i am sure its in their.

  • Cryptsetup: Swap encryption with supend-to-disk doesn't work

    Hello Community,
    i'm trying to get swap encryption with suspend-to-disk support to a working state.
    On my system only the /home partition is encrypted with cryptsetup-LUKS.
    I'm using the howto on "Using a swap file" (with /home/swapfile as swap file) in the wiki: https://wiki.archlinux.org/index.php/Dm … sk_support
    I followed exactly the given instructions:
    From /etc/mkinitcpio.conf
    HOOKS="base udev autodetect encrypt block resume filesystems keymap fsck"
    From /etc/default/grub
    GRUB_CMDLINE_LINUX="pcie_aspm=force pcie_aspm.policy=powersave pcie_port=native ipv6.disable=1 init=/usr/lib/systemd/systemd resume=/dev/mapper/crypthome resume_offset=16721572"
    From /etc/fstab:
    /home/swapfile none swap defaults 0 0
    The swapfile is working. Suspend-to-disk also works. But when resuming, I always get:
    ERROR: failed to open encryption mapping
    The device UUID=... is not a LUKS volume and the crypto= parameter was not specified
    running hook [resume]
    Waiting 10 seconds for /dev/mapper/crypthome
    ERROR: resume: hibernation device /dev/mapper/crypthome not found
    Then the system recovers the filesystem of / and later after the passphrase input of /dev/mapper/home it is forced to recover the filesystem of /home.
    Shouldn't I get a passphrase input when running the [resume] hook?
    Where is the problem I have missed?
    Thanks in advance!
    Last edited by indianahorst (2014-01-23 17:39:31)

    ball wrote:It seems that you've specified your home partition for the resume parameter, that is wrong. It should be the swap partition: https://wiki.archlinux.org/index.php/Su … parameters
    No. Have you read my posting completely?
    I don't use a swap partition.  I'm using a Swapfile on my encrypted home partition. See the link in the first posting and go to "Using a swap file".

  • What is the complexity of "Elliptic curve Pinstov Vanstone signature" algorithm?

    what is the complexity of "Elliptic curve Pinstov Vanstone signature" algorithm?

    Why do you ask? And why do you ask us?

  • Receiving bitlocker error in Event Viewer whenever i attach an external HD to my desktop (non are encrypted with bitlocker)

    Hello All,
    Seem to be having a problem recently.  Whenever I attach any external drive to my Desktop I receive the following error in Even Viewer.  I never encrypted any of the drives in question with bitlocker.
    Encrypted volume check: Volume information on \\?\Volume{7cc70383-5d6b-11e0-855c-001c25a5a540} cannot be read.
    Event ID: 24620
    And I cannot access my drive information.    At first i thought it may be an issue with one of the drives I have partially encrypted with TrueCrypt but I tried several other unencrypted drives and I receive the same error and I cannot access the
    data on my drives.
    I tried to access the Bit Locker Recovery tool program (downloaded the VISTA Version since there was no Windows 7 Version that I could find), but it did not allow me to install the recovery tool to attempt some kind of fixing.
    The strange thing is that I do not have Windows 7 Ultimate installed (which from what I understand is the only way to have Bitlocker).  I have windows 7 professional and I never encrypted my drives with bitlocker, 1 out of the 3 drives is partially
    encrypted with TrueCrypt, the other 2 are not encrypted with anything.
    The stranger thing is that I can plug the external drives to another laptop and I can access the data fine with no problem or errors.  I searched the forum for simliar problems, but did not see any responses with fixes to this issue.
    The only thing I can think of is that my Desktop downloaded and installed a bunch of Windows Updates within the last 4-5 days.
    heres is the update list
    http://farm6.static.flickr.com/5304/5890096650_431b0f3627_b.jpg
    Any assistance in attempting to figure this out would be appreciated.

    Hi,
    According to the error message, it should use
    BitLocker Repair Tool to fix it, refer:
    http://technet.microsoft.com/en-us/library/cc734057(WS.10).aspx
    What error message did you receive when you use BitLocker repair Tool?
    I notice one drive is encrypted with TrueCrypt, please use that program to unencrypt the drive for test.
    If it doesn’t work, since the issue didn’t appear before, you can try to perform a system restore to see the result.
    Hope that helps.
    Regards,
    Leo  
    Huang
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • How can I retrieve the password hint of an external drive encrypted with FileVault 2?

    Hi,
    I'm running on 10.7.3, I have an external HDD that is fully encrypted with FileVault 2.  When encrypting an external drive, FileVault 2 doesn't provide a recovery key, but it gives you the opportunity to give a hint at the time you enter the password.  My question is: how can I get this hint?
    I'm asking because I can't mount the drive anymore.  I keep getting prompted to enter the password, and although I believe I'm sure what the password is, it keeps getting refused.  The weird thing is that I have never been asked this password because the drive has always been automatically mounted after reboots, I guess because the password was in my Keychain.  I have no idea why it no longer auto-mounts and none of the passwords I tried worked.
    In Disk Utility, when I tried to "verify" the locked volume, Disk Utility logs an error in system.log with no other user visible action.  I filed a bug with Apple about this (#11286871) but I'm still waiting to hear back from them.  The error logged is:
    Apr 20 22:53:17 nowwhat Disk Utility[1508]: -[__NSCFDictionary setObject:forKey:]: attempt to insert nil value (key: diskIdentifier)
    Apr 20 22:53:17 nowwhat Disk Utility[1508]: (
                        0   CoreFoundation                      0x00007fff915bffc6 __exceptionPreprocess + 198
                        1   libobjc.A.dylib                     0x00007fff87a37d5e objc_exception_throw + 43
                        2   CoreFoundation                      0x00007fff915bfdfa +[NSException raise:format:arguments:] + 106
                        3   CoreFoundation                      0x00007fff915bfd84 +[NSException raise:format:] + 116
                        4   CoreFoundation                      0x00007fff9157cf3b -[__NSCFDictionary setObject:forKey:] + 219
                        5   DFA                                 0x000000010a1aa1b8 DFA + 25016
                        6   DFA                                 0x000000010a1ad701 DFA + 38657
                        7   DFA                                 0x000000010a1a61de DFA + 8670
                        8   CoreFoundation                      0x00007fff915af75d -[NSObject performSelector:withObject:] + 61
                        9   AppKit                              0x00007fff8e507cb2 -[NSApplication sendAction:to:from:] + 139
                        10  AppKit                              0x00007fff8e507be6 -[NSControl sendAction:to:] + 88
                        11  AppKit                              0x00007fff8e507b11 -[NSCell _sendActionFrom:] + 137
                        12  AppKit                              0x00007fff8e506fd4 -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 2014
                        13  AppKit                              0x00007fff8e586d04 -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 489
                        14  AppKit                              0x00007fff8e505bde -[NSControl mouseDown:] + 786
                        15  AppKit                              0x00007fff8e4d06e0 -[NSWindow sendEvent:] + 6306
                        16  AppKit                              0x00007fff8e46916d -[NSApplication sendEvent:] + 5593
                        17  AppKit                              0x00007fff8e3ff1f2 -[NSApplication run] + 555
                        18  AppKit                              0x00007fff8e67db88 NSApplicationMain + 867
                        19  Disk Utility                        0x0000000104c4e475 Disk Utility + 9333
                        20  Disk Utility                        0x0000000104c4e270 Disk Utility + 8816

    Even if you succeed with the difficult instructions to do this, if you are running Mavericks (10.9.x) on your Mac, count on it to start over with a whole new backup of your Mac, so you will have two separate backup files for the Mac on the Time Capsule.
    Realistically, few of us ever need to go back months or years to retrieve a file from Time Machine. My recommendation would be to keep the external hard drive around for a few months until you have a good backup history established for the Mac....and then delete the backups from the drive and use it as a spare hard drive.

  • I have my iPhone 4s backed up on my mac but it seems it was encrypted with a password which i do not remember is there any other option to retrieve to the backup without restoring the device as a new one. Also I do not have access to a windows system.

    I have my iPhone 4s backed up on my mac but it seems it was encrypted with a password which i do not remember is there any other option to retrieve to the backup without restoring the device as a new one. Also I do not have access to a windows system.

    Sorry no, if you don't knnow the encrypted password, then you can't use that backjup.

  • Does Adobe Reader for iOS and Android Support Encryption with PKI Solution?

    Hello there,
    I have been searching for an answer whether or not Adobe Reader for iOS and Android can read encrypted PDF files by public key infrastructure solution (encrypted by a public key, to be decrypted by its private key pair), but to date I have not found the answer.  From the Adobe web site, I understand that Adobe Reader for Android supports to read encrypted document by AES256 but it does not mention about PKI.  I had to guess that it does not support encryption with PKI but I would just like to get a formal answer, and would like to know whether Adobe Reader Mobile will support it. 
    Thanks!
    Masaya

    Hi there,
    Now we have Acrobat DC Mobile but I am still wondering if encryption/description using PKI solution (digital certificates) is supported.  Could anyone let me know?  Thank you.
    Masaya

  • Emulating HTTP POST for file upload with J2ME

    I have search through a lot of site and couldn't find the actual code. I try to emulate below html with J2ME.
    <form method="POST" enctype="multipart/form-data" action="Insert.asp">
    <td>File :</td><td>
    <input type="file" name="file" size="40"></td></tr>
    <td> </td><td>
    <input type="submit" value="Submit"></td></tr>
    </form>
    here is my code :
    HttpConnection c = null;
    InputStream is = null;
    OutputStream os = null;
    byte[] filecontent = file byte content ...
    try {
    c = (HttpConnection)Connector.open("http://xx.com/insert.asp");
    c.setRequestMethod(HttpConnection.POST);
    c.setRequestProperty("Content-Length", String.valueOf(cmg.length + 15));
    c.setRequestProperty("Content-type","multipart/form-data");
    os = c.openOutputStream();
    os.write("file=c:\\abc.png".getBytes());
    os.write(filecontent);
    os.flush();
    I can emulate form with text field and it work, but when it come to file upload, above code not working, I don't know what to put for the outputstream, filename ? content ? or both ? since the html only has one field that is the "file" field. The file is actually store in rms with filename abc.png, and I just put in the c:\ for the server as a dump path.

    File upload is more complicated then that... you need multi-part MIME formatting.... But I have just the code...
    http://forum.java.sun.com/thread.jspa?forumID=256&threadID=451245

Maybe you are looking for