Cannot decrypt RSA encrypted text : due to : input too large for RSA cipher

Hi,
I am in a fix trying to decrypt this RSA encrypted String ... plzz help
I have the encrypted text as a String.
This is what I do to decrypt it using the Private key
- Determine the block size of the Cipher object
- Get the array of bytes from the String
- Find out how many block sized partitions I have in the array
- Encrypt the exact block sized partitions using update() method
- Ok, now its easy to find out how many bytes remain (using % operator)
- If the remaining bytes is 0 then simply call the 'doFinal()'
i.e. the one which returns an array of bytes and takes no args
- If the remaining bytes is not zero then call the
'doFinal(byte [] input, int offset, in inputLen)' method for the
bytes which actually remained
However, this doesnt work. This is making me go really crazy.
Can anyone point out whats wrong ? Plzz
Here is the (childish) code
Cipher rsaDecipher = null;
//The initialization stuff for rsaDecipher
//The rsaDecipher Cipher is using 256 bit keys
//I havent specified anything regarding padding
//And, I am using BouncyCastle
String encryptedString;
// read in the string from the network
// this string is encrypted using an RSA public key generated earlier
// I have to decrypt this string using the corresponding Private key
byte [] input = encryptedString.getBytes();
int blockSize = rsaDecipher.getBlockSize();
int outputSize = rsaDecipher.getOutputSize(blockSize);
byte [] output = new byte[outputSize];
int numBlockSizedPartitions = input.length / blockSize;
int numRemainingBytes = input.length % blockSize;
boolean hasRemainingBytes = false;
if (numRemainingBytes > 0)
  hasRemainingBytes = true;
int offset = 0;
int inputLen = blockSize;
StringBuffer buf = new StringBuffer();
for (int i = 0; i < numBlockSizedPartitions; i++) {
  output = rsaDecipher.update(input, offset, blockSize);
  offset += blockSize;
  buf.append(new String(output));
if (hasRemainingBytes) {
  //This is excatly where I get the "input too large for RSA cipher"
  //Which is suffixed with ArrayIndexOutofBounds
  output = rsaDecipher.doFinal(input,offset,numRemainingBytes);
} else {
  output = rsaDecipher.doFinal();
buf.append(new String(output));
//After having reached till here, will it be wrong if I assumed that I
//have the properly decrypted string ???

Hi,
I am in a fix trying to decrypt this RSA encrypted
String ... plzz helpYou're already broken at this point.
Repeat after me: ciphertext CANNOT be safely represented as a String. Strings have internal structure - if you hand ciphertext to the new String(byte[]) constructor, it will eat your ciphertext and leave you with garbage. Said garbage will fail to decrypt in a variety of puzzling fashions.
If you want to transmit ciphertext as a String, you need to use something like Base64 to encode the raw bytes. Then, on the receiving side, you must Base64-DEcode back into bytes, and then decrypt the resulting byte[].
Second - using RSA as a general-purpose cipher is a bad idea. Don't do that. It's slow (on the order of 100x slower than the slowest symmetric cipher). It has a HUGE block size (governed by the keysize). And it's subject to attack if used as a stream-cipher (IIRC - I can no longer find the reference for that, so take it with a grain of salt...) Standard practice is to use RSA only to encrypt a generated key for some symmetric algorithm (like, say, AES), and use that key as a session-key.
At any rate - the code you posted is broken before you get to this line:byte [] input = encryptedString.getBytes();Go back to the encrypting and and make it stop treating your ciphertext as a String.
Grant

Similar Messages

  • Fdpstp failed due to ora-12899 value too large for column

    Hi All,
    User facing this problem while running the concurrent program.
    the program is complted but with rhis error.
    fdpstp failed due to ora-12899 value too large for column
    Can any one tell me the excat solution for this?
    RDBMS : 10.2.0.3.0
    Oracle Applications : 11.5.10.2

    User facing this problem while running the concurrent program.
    the program is complted but with rhis error.Is this a seeded or custom concurrent program?
    fdpstp failed due to ora-12899 value too large for column
    Can any one tell me the excat solution for this?Was this working before? If yes, any changes been done recently?
    Can other users run the same concurrent program with no issues?
    Please post the contents of the concurrent request log file here.
    Please ask your developer to open the file using Reports Builder and compile the report and run it (if possible) with the same parameters.
    OERR: ORA-12899 value too large for column %s (actual: %s, maximum: %s) [ID 287754.1]
    Thanks,
    Hussein

  • When scaling in page setup, 1st page prints correctly, but subsequent pages do not scale correctly/too large for the paper, parts of the text missing

    When trying to print in Firefox, and when scaling the page size in page setup, the first page prints correctly, but subsequent pages do not scale correctly and are too large for the paper, with parts of the text are being cut off at the top and right. This is not fixed by checking or un-checking the "ignore scaling/shrink to fit page width" in the print window, or by changing the scaling%.
    I am running Firefox 15.0.1, on Mac OS 10.5.8.
    The same problem happens in the print preview and if I save the print as a .pdf
    I have tried all the fixes in the how to's and others in various forums with no improvement.
    This happens every time I try to print a document scaled up or down only in Firefox.

    The 2nd page print scaling error has been an issue with Firefox on the Mac since 2011. People at Mozilla have not considered this a major problem. Try printing anything at less than 100% and you'll quickly see how every page after the first page being scaled wrong gets old real fast. The lack of a solution to this issue forced me long ago into using Safari as my primary browser. Good luck waiting until version 21 for a solution. Current release is 18.0.2.

  • Whats going on when after i have put my new project it tells me that cannot burn because my encode it too large for DVD

    I am trying to convert a video into a dVd i did one and it will not play on my blueray, but, at least it will do on my computer.  Now i am trying to do a different dvd and it tells me after i have downlowed my new project, that i cannot burn the idvd because it is too large check my encoded?

    The reason why your DVD will not play maybe your choice of disk.
    Was it a DVD + or DVD - ?
    Always use a good quality DVD blank disk, at least Verbatim and check what format your player will play.
    Next, to achieve the best quality export from iMovie, Share your Project to Media Browser.
    Then open iDVD and use the media button (bottom right) to import your movie.
    A possible reason that you are getting a too large error message is the time length of your DVD.
    The default setting in iDVD for Encoding is Best Performance (60mins) and you need to change this to either High Qualirty or Professional Quality which will allow more to be encoded on the disc (120 mins).
    iDVD > Project > Project Info > Encoding to change this setting and see on the Capacity slider if your project will fit.
    Otherwise check how much free space you have on your HD.
    Z.
    PS Slow your burn speed down to x4 for error free results.

  • How to decrypt an encrypted text file using  Algorithm SHA1withRSA .

    I have one encrypted file instance_demo_Encryp.xml and encrypted format is
    MIMVwmYGCSqGSIb3DQEHAqCDFcJWMIMVwlECAQExCzAJBgUrDgMCGgUAMIMVvzoG
    CSqGSIb3DQEHAaCDFb8qBIMVvyU8P3htbCB2ZXJzaW9uPScxLjAnIGVuY29kaW5n
    PSdVVEYtOCcgPz4NCjx4YnJsaTp4YnJsIHhtbG5zOnhicmxpPSdodHRwOi8vd3d3
    Lnhicmwub3JnLzIwMDMvaW5zdGFuY2UnIHhtbG5zOmxpbms9J2h0dHA6Ly93d3cu
    eGJybC5vcmcvMjAwMy9saW5rYmFzZScgeG1sbnM6eGxpbms9J2h0dHA6Ly93d3cu
    dzMub3JnLzE5OTkveGxpbmsnIHhtbG5zOnJlZj0naHR0cDovL3d3dy54YnJsLm9y
    Zy8yMDA0L3JlZicgeG1sbnM6eGJybGR0PSdodHRwOi8veGJybC5vcmcvMjAwNS94
    I want to decrypt and convert into original xml file.I am using below code but some error occurred javax.crypto.BadPaddingException: Data must start with zero.Please help
    import java.io.*;
    import java.math.BigInteger;
    import java.net.URLEncoder;
    import java.util.*;
    import java.security.AlgorithmParameters;
    import java.security.Key;
    import java.security.KeyFactory;
    import java.security.KeyPairGenerator;
    import java.security.KeyStore;
    import java.security.GeneralSecurityException;
    import java.security.MessageDigest;
    import java.security.PrivateKey;
    import java.security.PublicKey;
    import java.security.Signature;
    import java.security.cert.Certificate;
    import java.security.cert.CertificateFactory;
    import java.security.cert.X509Certificate;
    import java.security.spec.RSAPublicKeySpec;
    import java.security.spec.X509EncodedKeySpec;
    import javax.crypto.Cipher;
    import javax.crypto.CipherInputStream;
    import oracle.security.xmlsec.util.Base64;
    import sun.misc.*;
    //import org.bouncycastle.jce.provider.BouncyCastleProvider;
    //import org.bouncycastle.jce.*;
    public class EsignWithBC {
         public static final String KEY_STORE_PASSWORD = "password";
         public static void main(String[] args) {
               BASE64Encoder base64Encoder = new BASE64Encoder();
               BASE64Decoder base64Decoder = new BASE64Decoder();
              String record = null;
              char[] passwd = KEY_STORE_PASSWORD.toCharArray();
              String inputFileName = "webroot/cerFiles/instance_demo_Encryp.xml";
              try {
                   KeyStore keyStore = KeyStore.getInstance("PKCS12");
                   FileInputStream fis = new FileInputStream(
                             "D:\\eclipse_program\\xRnd\\WebRoot\\cerFiles\\AlicePFX.pfx");
                   keyStore.load(fis, passwd);
                   fis.close();
                   Enumeration aliases = keyStore.aliases();
                   while (aliases.hasMoreElements()) {
                        System.out.println(aliases.nextElement());
                   /*FileInputStream fin = new FileInputStream("D:\\eclipse_program\\xRnd\\WebRoot\\cerFiles\\Alice.cer");
                    CertificateFactory cf = CertificateFactory.getInstance("X.509");
                    Collection c = cf.generateCertificates(fin);
                    Iterator i = c.iterator();
                    while (i.hasNext()) {
                       Certificate cert = (Certificate)i.next();
                       System.out.println("***************************************************");
                       System.out.println(cert.getPublicKey());
                       System.out.println("***************************************************");
                    String filename= "D:\\eclipse_program\\xRnd\\WebRoot\\cerFiles\\Alice.cer";
                    FileInputStream fis1 = new FileInputStream(filename);
                    DataInputStream dis = new DataInputStream(fis1);
                    CertificateFactory cf1 = CertificateFactory.getInstance("X.509");
                    byte[] bytes = new byte[dis.available()];
                    dis.readFully(bytes);
                    ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
                    Key key = null;
                    while (bais.available() > 0) {
                       Certificate cert = cf1.generateCertificate(bais);
                       key = cert.getPublicKey();
                       System.out.println(cert.toString());
                   // EsignWithBC obj = new EsignWithBC();
                    //System.out.println(obj.createUrlFragment("alice's key","password","D:\\eclipse_program\\xRnd\\webroot\\cerFiles\\instance_demo_Encryp.xml"));
                    FileReader fr = new FileReader(inputFileName);
                        BufferedReader br = new BufferedReader(fr);
                        byte text[] = null;
                         //System.out.println(text.toString());
                   // Cipher cipher = Cipher.getInstance("SHA1withRSA");
                        KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");
                        Signature sig = Signature.getInstance("SHA1withRSA");
                        Cipher rsaCipher = Cipher.getInstance("RSA");
                        String str = null;
                         byte[] cleartext1 = null;
                        rsaCipher.init(Cipher.DECRYPT_MODE, key);
                        System.out.println("********************************");
                        while ( (record=br.readLine()) != null ) {
                              text = base64Decoder.decodeBuffer(record);                         
                              cleartext1 = rsaCipher.doFinal(text);
                              //str = new String(cleartext1);
                              System.out.println(rsaCipher.doFinal(text));
                        System.out.println("********************************");
              } catch (Exception e) {
                   e.printStackTrace();
    }

    SHA1withRSA is a signature algorithm and not an encryption. If all you have is the signature then you can never get back the original document. The best you can do is to check that the signature is valid but for that you will need the original document and the public key of the person who signed the document.
    The code you post is not coherent and though I think can see what you are trying to do I am not willing to make guesses at this stage since it sounds like you are trying to do the impossible.

  • Cannot download Flash Player 10 due to - Error opening file for writing: Flash10d.ocx

    Hello all,
    I am having difficulty installing Flash Player 10. I open it up, and only 10% of the download bar finishes before I get the message:
    "Error opening file for writing:
    C:\Windows\system32\Macromed\Flash\Flash10d.ocx"
    I am running Windows Vista with Internet Explorer, although I'm not 100% sure which version of IE it is and haven't found out how to check. I have McAfee for security, but I have already tried disabling the Firewall with no success.
    My computer is new, so there's a chance that it already has Flash Player 10 on it since it belonged to someone else before it came to me, but I don't know how to check that either.
    Any suggestions?
    Thanks!

    Let me clarify:
    I have already tried disabling the firewall and running the installer again, but it didn't work.

  • Adobe Interface too large for screen-cannot read

    Have just downloaded free trial of Adobe Acrobat Pro 9 beta
    -- cannot see the entire screen -- can anyone help?
    Thank you!

    Hi boraxo99,
    Thanks for your post. However, this Forum is meant to discuss
    issues related to acrobat.com and not acrobat. To post an issue
    related to acrobat please visit the acrobat forum :
    http://www.adobeforums.com/cgi-bin/webx/.3bbeda8b/
    You may also open a web case with Adobe Support. To do so,
    please visit the following link :
    https://www.adobe.com/cfusion/support/index.cfm?event=portal

  • Still cannot cut and paste - all instructions are way too technical for avg user trying to fix the problem. Need step by step instructions.

    Firefox is not enabling me to cut and paste when I'm working on my business website. I can tried the key commands and they didn't work either. The instructions that were linked for Changing the preferences in Firefox were very complicated and even when I thought I found the correct place to add the user_pref lines to allow clipboard, the message was DO NOT MODIFY THIS PAGE.
    I didn't want to add or change anything for fear of screwing this up.
    What I need are step by step instructions. Really baby steps. How to find the profile and the js.file, what is text editor? If you could take instruct from start to finish that would be great.
    Thank You!

    Use the keyboard shortcuts if the buttons on the web page or other methods aren't working.
    * Copy: Ctrl+C or Ctrl+Insert (Mac: Command + C)
    * Paste: Ctrl+V or Shift+Insert (Mac: Command + V)
    * Cut: Ctrl+X or Shift+Delete (Mac: Command + X)

  • My iPhone 5c is stuck onto zoom I cannot get into phone as buttons too large for pass code to press and hence lockdown after several attempts can't get access to settings tried turning off and on and also took sim out and back any help appreciated

    mmy I phone 5 c is stuck on large close up (zoom)
    i therefore can't get into the phone as the pass code to get in is difficult to get everytime you get two numbers I you can't get the other two
    so this has caused the lockdowns ..many times... I am now waiting to try again in 23 minutes but same thing will happen again as all the numbers are not displayed on the screen
    i I don't know if I have done anything as it was all working fine up to last night and been like this ever since
    i I have taken out the sim and put back
    aany help appreciated thanks

    There are two ways to turn off Zoom:
    1. Connect to iTunes. Go to the iPhone summary pane and click the "Configure Universal Access" button. Then turn Zoom off.
    2. Double-tap the phone's screen with three fingers. Then go to Settings -> General -> Accessibility -> Zoom and tap the Zoom On/Off switch.

  • Install fails due to ORA-12899: value too large for column

    Hi,
    Our WCS 11g installation on Tomcat 7 fails giving a "ORA-12899: value too large for column".
    As per the solution ticket https://support.oracle.com/epmos/faces/DocumentDisplay?id=1539055.1 we have to set "-Dfile.encoding=UTF-8" in tomcat.
    We have done this beforehand by setting the variable in catalina.bat in tomcat 7 bin as shown below
    But still we get the same error while installation.
    If anybody has faced this , let us know how you resolved it

    We were unable to install WCS on Tomcat 7 but on Tomcat 6 by specifying "-Dfile.encoding=UTF-8" in java options using "Tomcat Configure" it was succesful.
    An alternative we found was to increase the value of the column itself.
    Using command
    ALTER TABLE csuser.systemlocalestring
    MODIFY value varchar2 (4000)

  • Pie Chart legend text when drill down too larger

    Dear Gurus,
    I have this report with Pie chart:
    *)Table:
    Element Group
    Earnings 100
    Deductions 30
    When drill down (after click on Earnings/Deductions), it become detail like this:
    Element Group Classification Name
    Earning Regular
    Earning Irregular
    And the Pie chart legend show this: Earnings, Regular Earnings
    ->how to remove Earnings?I just want to show classification name as legend.
    I use OBIEE 11.1.1.3
    Any help will be appreciated
    Regards
    Joe
    Edited by: JoeSSI on Aug 10, 2012 12:33 AM
    Edited by: JoeSSI on Aug 10, 2012 12:35 AM
    Edited by: JoeSSI on Aug 10, 2012 3:24 AM

    Hi Joe,
    There was a bug associated with repeated legends in 11.1.1.3 version.Can you check the below document and see if the mentioned patch helps,
    Vertical Bar Charts In OBIEE 11g Display Repeated Labels In The Graph Legend [ID 1376185.1]
    Regards,
    Dpka

  • Audio input too small for 1/4 mono adapter??? Help!!!

    Hi, I would like to record myself with garage band by plugging my bass in a 1/4 mono jack adapter in my macbook pro audio port. The problem is that when I plug the adapter, it goes to 2 / 3 of its size and blocks. I don't want to try to push the adapter further in case the audio imput breaks. I noticed that the tip of the adapter was a little bigger than a normal headphone jack. Do you think this might be the problem? Do you think apple might anable some cable sizes to fit in their audio ports?
    The adapter looks like this http://www.musiconmypc.co.uk/guitar-cable-to-pc-mac-adaptor-6-3mm-mono-jack-to-3 -5mm-mono
    Thanks.

    How large is the device that you are formatting?
    The default journal size depends on the type specified. If none specified,
    then it assumes "mail" which sets the default journal per slot to 256M.
    If database type, default is 64M.
    Use "-T database" to specify database type, etc.
    BTW, one can always override the defaults. Say "-J size=16M" to make
    a smaller journal.
    man mkfs.ocfs2 and the user's guide has more.

  • Error in BDC - screen 0000 is too large for internal batch input area

    Hi While I was running a BDC program for MR21  I am facing the following error after I enter 37 records.
    If I enter records less that 37 then upload was successful.
    I have even used OPTIONS in call transaction statement inorder to avoid dependancy on resolution.
    Please help me out in this.

    you cna try with below BAPI's
    BAPI_M_REVAL_CREATEPRICECHANGE
    BAPI_MATVAL_PRICE_CHANGE

  • Getting unformatted text after decryption of formatted encrypted text

    The problem getting unformatted text after decryption of a formatted encrypted text.
    Im using Bouncy Caslte for encrypting the mail message.its a well formatted text but
    after decryption its unformmated?
    What will be the problem? why im getting the decrypted text as unformatted?

    sorry im using Bouncy Castle for encryption
    This is my code
    try {               
                   Security
                             .addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
                   KeyStore ks = KeyStore.getInstance("PKCS12", "BC");
                   ks.load(new FileInputStream("C:/rajesh/raj_gmail.cer"), "tomcat".toCharArray());
                   Enumeration e = ks.aliases();
                   String keyAlias = null;
                   String alias = null;
                   while (e.hasMoreElements()) {
                        alias = (String) e.nextElement();
                        if (ks.isKeyEntry(alias)) {
                             keyAlias = alias;
                   Certificate[] chain = ks.getCertificateChain(keyAlias);
                   // create the generator for creating an smime/encrypted message
                   SMIMEEnvelopedGenerator gen = new SMIMEEnvelopedGenerator();
                   gen.addKeyTransRecipient((X509Certificate) chain[0]);
                   Properties props = System.getProperties();
                   try {
                        InputStream path = getServlet()
                                  .getServletContext()
                                  .getResourceAsStream(
                                            "/WEB-INF/classes/com/ips/ApplicationResources.properties");
                        props.load(path);
                   } catch (Exception e1) {
                        System.out.println("Not able to load the properties file");
                   props.put("mail.smtp.host", props.getProperty("mail.smtp.host"));
                   Session session = Session.getDefaultInstance(props, null);
                   MimeMessage msg = new MimeMessage(session);
                   String body_heading = props
                             .getProperty("mail.request.message.body");
                   body_heading = body_heading.replaceAll("[{]{1}[0]{1}[}]{1}",
                             Integer.toString(forms));
                   msg.addRecipient(Message.RecipientType.TO, new InternetAddress(
                             props.getProperty("mail.to.address")));
                   msg.setSubject(props.getProperty("mail.request.message.subject"));
                   StringBuffer body = new StringBuffer();
                   body.append(body_heading);
                   body.append(props.getProperty("mail.linebreak")
                             + props.getProperty("mail.line1"));
                   body.append(props.getProperty("mail.linebreak")
                             + props.getProperty("mail.contact"));
                   body.append(props.getProperty("mail.linebreak")
                             + props.getProperty("mail.line2"));
                   body.append(props.getProperty("mail.linebreak")
                             + props.getProperty("mail.message.title")
                             + props.getProperty("mail.colon")
                             + String.format("%15s", title));
                   body.append(props.getProperty("mail.linebreak")
                             + props.getProperty("mail.message.fname")
                             + props.getProperty("mail.colon")
                             + String.format("%17s", firstname));
                   body.append(props.getProperty("mail.linebreak")
                             + props.getProperty("mail.message.lname")
                             + props.getProperty("mail.colon")
                             + String.format("%17s", lastname));
                   body.append(props.getProperty("mail.linebreak")
                             + props.getProperty("mail.message.address1")
                             + props.getProperty("mail.colon")
                             + String.format("%19s", address1));
                   body.append(props.getProperty("mail.linebreak")
                             + props.getProperty("mail.tab")
                             + props.getProperty("mail.colon")
                             + String.format("%20s", address2));
                   body.append(props.getProperty("mail.linebreak")
                             + props.getProperty("mail.tab")
                             + props.getProperty("mail.colon")
                             + String.format("%20s", town));
                   body.append(props.getProperty("mail.linebreak")
                             + props.getProperty("mail.tab")
                             + props.getProperty("mail.colon")
                             + String.format("%20s", county));
                   body.append(props.getProperty("mail.linebreak")
                             + props.getProperty("mail.message.pcode")
                             + props.getProperty("mail.colon")
                             + String.format("%11s", postcode));
                   body.append(props.getProperty("mail.linebreak")
                             + props.getProperty("mail.message.email")
                             + props.getProperty("mail.colon")/*
                                                                      * +String.format("%33s",email
                   body.append(props.getProperty("mail.linebreak")
                             + props.getProperty("mail.message.thanks"));
                   MimeBodyPart bp1 = new MimeBodyPart();
                   bp1.setText(body.toString());
                   bp1 = gen.generate(bp1, SMIMEEnvelopedGenerator.RC2_CBC, "BC");
                   Multipart multipart = new MimeMultipart();
                   multipart.addBodyPart(bp1);
                   msg.setContent(multipart);
                   msg.saveChanges();
                   Transport.send(msg);
              } catch (Exception e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              }if i print the original text im getting the content in my mail as
    Please send me 1 application form pack(s)
    Contact Details
    Title: Mr
    First name: rchanged
    Last name: rchanged
    Address: rchanged
    : rchanged
    : r
    : r
    Postcode: r4 4rr
    Email:
    Thank You
    if encrypted is send
    Please send me 1 application form pack(s) ------------------------------------------------------ Contact Details ------------------------------------------------------ Title: Mr First name: rchanged Last name: rchanged Address: rchanged : rchanged : r : r Postcode: r4 4rr Email: Thank You

  • Is it enough only use RSA encryption?

    Hi all,
    I want to know is it enough if we develop Java Card application by using only RSA encryption?..
    if on-card application uses RSA, and so off-card application uses RSA, is it mean that we have to use 2 KeyPairs?..
    I mean, the off-card shall generate Pub and Priv Key, Keep Priv-Key secret, and the Pub key is distributed to card..
    and of course on-card do same thing, it will generate Pub and Priv Key, Keep Priv-Key secret, and the Pub key is distributed to Off-card application..
    Please correct me if this wrong..
    if this isn't wrong, do i still have to use X509Certificate?..
    Thanks in advance,,

    Thanks Lexdabear and Shane for your reply..
    Actually, i'm a little bit confused how do i can make sure the data is being sent is confidential and valid (it means that the data received by receiver is same with the data sent by sender)..
    Hm, i read from the PDF document that i downloaded from the internet, says that :
    &#9679; Signing
    Use private key to “sign” data
    &#9679; Verification
    Use public key to verify “signature”
    &#9679; Encryption
    Use public key to encrypt data
    &#9679; Decryption
    Use private key to decrypt data
    Can i mix these features together if i only use single RSA Key-Pair (only on the card side)?, assume that the on-card application hold only Private-Key, can on-card do these features together ((encrypt, decrypt, sign, verify) if it has only Private Key? ..
    based on that, it means that if we use only single RSA KeyPair, assume that the Card holds the Private Key and the Off-card holds the Public-Key, so the application in the card can only do Sign and Encrypt data before data sent to the off-card, and of course, the off-card can only do Verify signature and Decrypt data received..
    So, how the card can decrypt and verify the signature of the data sent by off-card if the card doesn't hold the public key of the off-card ?
    i thought the off-card SHOULD send its Public-Key to the on-card application, so the On-Card application can do Decrypt and Verify the signature of data sent by Off-Card..
    i thought single RSA keypair isn't enough (My point of view as a less of experience programmer)
    Please correct me if i'm wrong..
    Thanks in advance..
    Edited by: Leonardo_Carreira on Jun 22, 2010 2:22 AM

Maybe you are looking for