Have a problem when encrypt by RSA !!!

I have a method
public static byte[] EncryptByPublicKey(byte[] text, PublicKey key) {
        //byte[] encryptText = null;
        try {
            Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
            cipher.init(Cipher.ENCRYPT_MODE, key);
            return cipher.doFinal(text);
        catch (Exception e){
            System.out.println("Err " + e.toString());
        return null;
    }I write a class test this method
public static void main(String[] args){
        PublicKey pub = ReadPublicKey("publicReceiver.k");
        String message = "abc";
        String encryptText =
                    new String(EncryptByPublicKey(message.getBytes(), pub));
        System.out.println(encryptText);
    }when I execute the minutes each are different results for each.
help me please, thanks a lot of

PKCS1 padding in encryption mode uses random bytes for the padding so you should pretty much always get a different resultant encrypted result.
Note - the bytes of the ciphertext should never be turned into readable text using new String(ciphertext) since one cannot guarantee that all bytes and byte sequences are valid for your default character encoding. Use Base64 or Hex encoding.

Similar Messages

  • How do I stop Firefox from creating untitled web pages when I try to send email from a web page. The only way I have found is to turn the computor off and then reboot. I don't have this problem when using Internet Explorer

    Every time I click on a web site that has an email option the browser starts making untitled web pages and never stops unless I turn the computer off. It is very frustrating to not be able to use an email option when offered by a web site. The only way I can send email messages on the Firefox browser is to go into my hotmail acct. and copy and paste the addresses. I don't have this problem when I use the Internet Explorer browser.

    See [[Firefox keeps opening many tabs or windows]]

  • TS2755 Hi all, I bought one iphone and 3 ipads, i set up all on one apple ID. Now i have a problem when using messages: when sending message from one device it appears again on screen from the other 3 devices. I need help of how to set up messages on each

    Hi all, I bought one iphone and 3 ipads, i set up all on one apple ID. Now i have a problem when using messages: when sending message from one device it appears again on screen from the other 3 devices. I need help on how to set up messages on each device separately and to start using messages app on each device independently. Thanks

    search google for "iphone remove picture from contact"

  • Hello everyone, I have a problem when I sync my apple device. I plug it in and a message comes up saying, this device could not be synced because this computer is not authorized for the purchased items on this phone. I already tried to authorize again.

    Hello everyone, I have a problem when I sync my apple device. I plug it in and a message comes up saying, this device could not be synced because this computer is not authorized for the purchased items on this phone. I already tried to authorize again, after deautherizing it. HELP ME PLEASE

    Hi applerinneedforhelp,
    Thanks for visiting Apple Support Communities.
    If iTunes is asking you to authorize the computer, and you've already done so, the troubleshooting steps in this article can help:
    iTunes repeatedly prompts to authorize computer to play iTunes Store purchases
    http://support.apple.com/kb/ts1389
    Regards,
    Jeremy

  • I have some problem when I want to download app in iTunes some security question ask me about my visa when I right my visa number I got an errors and on top of the page told me go to iTunes support I do these things and now what should I do

    I have some problem when I want to download app in iTunes some security question ask me about my visa when I right my visa number I got an errors and on top of the page told me go to iTunes support I do these things and now what should I do

    Most of the people on these forums, including myself, are fellow users - you're not talking to iTunes Support here.
    You can contact iTunes Support via this link : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • Hi There, I have a problem when trying to print either Email or from a web page.

    Hi There,
    I have a problem when trying to print contents fro either Email's or from web pages, the problem started after i opened Google earth and it down loaded Google Chrome i do not like Google chrome so i removed it from my pc via add and remove programmes since then when i try to print an email i get what looks like the computer settings for writing the email and not the text same for web pages, as anyone come across this problem before i can print any word or spreadsheet documents but problem is with email's and web pages.
    Many Thanks.

    Something changed on your system, possibly when Google Chrome installed. It could  be many things, but what it boils down to, is it needs to go back to the way it was. Either by removing whatever else might still be left from the install, or maybe by reinstalling the printer itself.
    007OHMSS
    I was a support engineer for HP.
    If the advice resolved the situation, please mark it as a solution. Thank you.

  • HT1386 I HAVE A PROBLEM WHEN SYNC CONTACTS IN MY COMPUTER TO IPHONE 4S after update to iOS6. The message are " waiting for change to be applied".

    I HAVE A PROBLEM WHEN SYNC CONTACTS IN MY COMPUTER TO IPHONE 4S after update to iOS6. The message are " waiting for change to be applied".
    PLAESE advise how to solve this problem.

    Hi applerinneedforhelp,
    Thanks for visiting Apple Support Communities.
    If iTunes is asking you to authorize the computer, and you've already done so, the troubleshooting steps in this article can help:
    iTunes repeatedly prompts to authorize computer to play iTunes Store purchases
    http://support.apple.com/kb/ts1389
    Regards,
    Jeremy

  • Hello i have a problem when i start woorksheet, my computer crash with blue screen sometimes.

    hello i have a problem when i start woorksheet, my computer crash with blue screen.
    OS: Win 2000 pack 2 and dasylab 7.00.05 ;ddi7.02 ;nidaq 7.0
    I hve this problem sometimes and need to reebot my computer.This worksheet is used to generate 4 signals to output and have an acquisition tooin this 4 channels.
    The error is in the blue screen:0x00000076 (0x00000000 , 0x81358300, 0x000001c2, 0x00000000).
    Thanks for your help.

    The DASYLab development team has read your message, and advises that there is insufficient information to be able to even start diagnosing the problem. We suggest that you send a note directly to [email protected], with your full contact information, DASYLab serial number, and the following technical information:
    -The Help-->Report information - this will tell us more about the computer, video and installed memory
    -Installed hardware - what DAQ devices are you using (exact models!)
    -The worksheet that crashes - we need to see how the timing is configured in the worksheet
    -What other programs are running at the same time?
    -Does the worksheet crash every time?
    -Does the NI-DAQ Test Panel work correctly for both inputs and outputs?
    Sorry that we cannot be more help in this forum; we do not have much experience with blue screen under Windows 2000. This is very hard to do, and is almost always related to a hardware problem - either a resource conflict, or problems with one of the installed hardware devices (DAQ, Video, Memory...).
    Regards,
    -cj
    - cj
    Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.

  • TS1967 i have a problem when i try to update or install apps in my ipad, and a message come up says "can not connect to Itunes Store", anyone know why? please advise. however i had update all my detail of payment method.

    i have a problem when i try to update or install apps in my ipad, and a message come up says "can not connect to Itunes Store", anyone know why? please advise. however i had update all my detail of payment method.

    Settings > General > Reset > Reset Network Settings.
    Power cycle the router.
    Basic troubleshooting from the User's Guide is reset, restart, restore (first from backup then as new).  Try each of these in order until the issue is resolved.

  • I have a problem when running my own EJB as a TUXEDO service using WTC.

    Hello,
    I have a problem when running my own EJB as a TUXEDO service using WTC. I am using TUXEDO 8.1 and WL 9.1.
    When I am trying to run my own EJB as a TUXEDO service error appears.
    TPENOENT(6):0:0:TPED_MINVAL(0):QMNONE(0):0:Could not find service TOUPPER
    at weblogic.wtc.gwt.WTCService.getImport(WTCService.java:4988)
    at weblogic.wtc.gwt.TuxedoConnection.getImport(TuxedoConnection.java:303)
    at weblogic.wtc.gwt.TuxedoConnection.tpcall(TuxedoConnection.java:1302)
    at examples.MyTestSessionBean.Toupper(MyTestSessionBean.java:102)
    at examples.TestSessionBean_knby6k_EOImpl.Toupper(TestSessionBean_knby6k_EOImpl.java:61)
    at net.roseindia.web.servlets.SessionTestServlet.doGet(SessionTestServlet.java:69)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3153)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1973)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1880)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1310)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
    e8
    10
    java.rmi.RemoteException: EJB Exception: ; nested exception is:
    java.lang.NullPointerException
    at weblogic.ejb.container.internal.EJBRuntimeUtils.throwRemoteException(EJBRuntimeUtils.java:95)
    at weblogic.ejb.container.internal.BaseEJBObject.handleSystemException(BaseEJBObject.java:713)
    at weblogic.ejb.container.internal.BaseEJBObject.handleSystemException(BaseEJBObject.java:681)
    at weblogic.ejb.container.internal.BaseEJBObject.postInvoke1(BaseEJBObject.java:447)
    at weblogic.ejb.container.internal.StatelessEJBObject.postInvoke1(StatelessEJBObject.java:72)
    at weblogic.ejb.container.internal.BaseEJBObject.postInvokeTxRetry(BaseEJBObject.java:374)
    at examples.TestSessionBean_knby6k_EOImpl.Toupper(TestSessionBean_knby6k_EOImpl.java:75)
    at net.roseindia.web.servlets.SessionTestServlet.doGet(SessionTestServlet.java:69)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3153)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1973)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1880)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1310)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
    Caused by: java.lang.NullPointerException
    at examples.MyTestSessionBean.Toupper(MyTestSessionBean.java:130)
    at examples.TestSessionBean_knby6k_EOImpl.Toupper(TestSessionBean_knby6k_EOImpl.java:61)
    ... 15 more
    Any clue on this.
    With Regards,
    MVS

    If you are trying to create a Tuxedo service in Java using WTC you need to develop an EJB that implements the TuxedoService interface and register its home in JNDI so WTC can look it up. Once that is done you can then export the service to a remote domain in the WTC configuration.
    Regards,
    Todd Little
    Oracle Tuxedo Chief Architect

  • I have a problem when I updated CS6:

    hi,
    I have a problem when I updated CS6:
    Extension Manager 6.0.5 Update
    Installation failed. Error Code: U44M1P7
    Adobe Photoshop 13.0.5
    Done with Errors. Error Code: U44M1P6
    What is it?
    Thx
    Message was edited by: PhotoPlusMore

    www.photoplusmore.com.au       
        m: 0408 96 11 40
        p: (02) 955 22 707
    Begin forwarded message:
    From: Lee_Ann_H <[email protected]>
    Subject: I have a problem when I updated CS6:
    Date: 23 June 2013 2:40:39 PM AEST
    To: PhotPlusMore <[email protected]>
    Reply-To: [email protected]
    Re: I have a problem when I updated CS6:
    created by Lee_Ann_H in Adobe Creative Cloud - View the full discussion
    Hi PhotPlusMore, these links may help.
    Extension Manager: http://helpx.adobe.com/creative-suite/kb/error-u44m1p7-installing-upda tes-ccm.html
    Photoshop: http://blogs.adobe.com/photoshopdotcom/2013/06/photoshop-cs6-13-0-5mac -13-0-1-2win-perpetual-license-updates-now-available.html
    Let us know if you're still having trouble. Thanks!
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5440165#5440165
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5440165#5440165
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5440165#5440165. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Adobe Creative Cloud by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • I have a problem when updated the new release of iphoto version(11 jun 2012). After that I cannot open any photo libraries and program is error.

    I have a problem when updated the new release of iphoto version(11 jun 2012). After that I cannot open any photo libraries and program is error. I must to force quit iphoto window. There are any fixed bug update.

    If you have no photos:
    Hold down the option (or alt) key key and launch iPhoto. From the resulting menu select 'Create Library' and start.
    Regards
    TD

  • I have a problem when I open the new tab?

    I have a problem when I open the new tab. Normaly, I open the new tab as click mouse in button near to last page. " new tab" appear with untitled page. But now , It always appear with web sites wich I don't like. So, How can i repare this problem ?

    This feature is likely to have been added by an extension. Check the settings for your extensions to see if they show this feature.
    Another method of identifying the extension that is causing this is to disable extensions, for details on this process see https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • I have a problem when updating applications on iOS 7.0.2

    I have a problem when updating apps on iOS 7.0.2 to go to the appstore I get the update but only tells me open, not update, I have to uninstall and reinstall te app and gives me the option to update. Sorry my bad english

    I am in the process of installing 9i on SUSE Linux 7.2. The only Linux that is certified to run 9i. The machine is is a fresh install of SUSE. I am running into the same problem. I ran through the first make problem by going to a shell and invoking a make -f oemagent.mk. Built the library just fine. Got errors when trying to run make -f ins_rdbms.mk. Not sure why the installer or the command line is having problems.
    Not sure if I can just hit Ignore and go on????
    Any help would be appreciated. You would think 9i would spread like butter on their "Certified" platform.

  • I have a problem when ı want to update and restore my ipad for ios5 : an error occurred while restoring this ipad (-10), what can i do??

    i have a problem when ı want to update and restore my ipad for ios5 : an error occurred while restoring this ipad (-10), what can i do??

    Error -1 is not mentioned in this article about error messages during a restore process: http://support.apple.com/kb/TS3694
    This one comes close:
    The device could not be restored. An internal error occurred, or Error 3200: This indicates a network-connectivity or traffic issue. If you see this error, wait an hour or more and try again.
    You may also check your security software settings, to make sure that iTunes can contact Apple servers during this process: iTunes for Windows: Troubleshooting security software issues

Maybe you are looking for

  • Why do my iTunes playlists not show up on Apple TV?

    Apple TV does not appear to show playlists created in iTunes?  How do I create and play a playlist on Apple TV?

  • Itunes and Windows 8.1 tablet

    I plan to buy an Asus tablet that runs Windows 8.1 and would like to know if I can download, install and use Itunes. Can someone let me know? thanks.

  • First my Super Drive, now my new Pioneer DVD drive.

    This has been an ongoing problem that I have worked around, but the time has come to address it directly. Just pass the warranty period on my Mac Pro, the Super Drive started acting up, would only eject intermittently. This went on until it would not

  • Content deleted by Moderator

    Content deleted by Moderator, as breach of Code of Conduct. Edited by: ForumModerator on 11-Jun-2009 04:30

  • Set default font?

    When I try to set default font on my JMenuBar like this: javax.swing.UIManager.put("JMenuBar.font",new Font("Verdana",Font.PLAIN, 14)); nothing happens? Can someone help me with this.