Save and Reuse Key

Hi! i am writing a code to encrypt a text message using Blowfish algorithm and i m generating it's key using the following code
KeyGenerator keygen=KeyGenerator.getInstance("DES");     
SecretKey key=keygen.generateKey();
Cipher cipher = Cipher.getInstance("DES");
cipher.init(Cipher.ENCRYPT_MODE,key);
Now,_the problem is that i want to transfer the encrypted text to some other user and for that i need to SAVE THE KEY generated above and send the same to that user.HOW can i do that? Can i display the key on the screen or write to some file?How can i reuse the key for decryption at the other end?+_                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

My Question is ,how can i get the key generated above as a string which is in the form that can be transferred.
What i m getting is this
javax.crypto.spec.SecretKeySpec@2685004b+_
Now the question is how to extract the actual key from this o/p and save it to some db or some file and then regenerate it next time i try to decrypt the previously encrypted message. I m offline means to send the key.

Similar Messages

  • Query property "Save and reuse variable value" doesn't work in BW EHP1

    We have a workbook which contain 4 queries, every different worksheet is a different query.
    All the queries are on the Same InfoCube and all the queries use the same variables.
    In the properties of the query n.2 we set the parameter "Save and reuse variable values" then we refresh the 1st query and all work fine (the system asks the variable values) but when we refresh the 2nd query the system doesn't use the same variable values that we have inserted for the query n.1
    We don't have the same problem in 7.0.
    Any help is appreciated.
    Luca

    Hi,
    I suppose, you need to set the 'Save and reuse variable values' for each query individually in the workbook. I am not sure however there is a option where you can specify to apply the settings of one query to all queries in the work book.
    Please check and hope it helps.
    Regards,
    Adarsh Mhatre

  • Save and reuse elements in a new Project

    Firstly, ^5 on Edge Reflow! I love it to bits!
    Will you guys allow to save elements to the assets library in order to use those elements in a new Project? (not a new page in the current project.)
    Guess similar to an predefined assets library where you drag and drop elements, but creating your own and saving it. Like Fireworks?
    Many Thanks!

    A lot of this depends on your sequence setting and your output device.  So thoughts:
    You want to get these elements to a standalone file just in case you re-install or upgrade CS4 and your project directory (and hence your template) gets erased or moved.
    If, for example, your output is a DVD or BD and the standard elements are, say a logo, you could use AME to create the MPEG or H.264 that you can then import into Encore as an asset everytime you do a project.  Saves rendering time.
    Otherwise, you use AME to create an export file --probably uncompressed, or at a minimum MS AVI with the corect aspect ratio and dimensions.
    What I have done with standard footage in a HDV sequence, is to export with AME to a 1440 x 1081i 1.33 MPEG2 file.  At the fundamental level the HDV file (removed from the streaming envelope used with tape) is MPEG2.  (I think I remember this correctly)

  • I can edit on Premiere Pro 6 files, but after a dozen keystrokes, the space bar and cursor keys stop working while the save function works

    I can edit on Premiere Pro 6 files, but after a dozen keystrokes, the space bar and cursor keys stop working while the save function, render workspace function, export file are still operational. How can I fix it so I may complete my assignment?
    Besides DaVinci Resolve, Adobe Creative Suite 6 is the only software on the machine. I am using Windows 7 Professional 64-bit Operating System on AMD FX 6100 six-Core Processor at 3.31gHz and 32 GB RAM memory. There are two SLI-bridged GTX680 NVidia cards.
    The software was very stable for the last six months, working with 720P proxy files from 2.5K masters (Blackmagic Design Camera). I am working on a feature-length project that exceeds 1000 edits. I have broken the file into 2 one hour segments.
    I have deactivated the software before reinstalling the entire OS from scratch. PP6 was very stable for 48 hours. Then the freezing space bar returns. After a dozen strokes into the project, same problem.  I have made cache files store next to originals, I have deleted preview files if they were corrupted and causing instability. Am I missing something?
    I have Microsoft Security Essentials for virus protection. I double checked the memory for damage/defect. Nothing says that the motherboard or other components are damaged.
    I am in film competition overseas and need to have deliverables in less than a month's time.  I lost the last two weeks troubleshooting and this crisis came at an inopportune moment of the project.
    Any assistance would be greatly appreciated.

    Still getting software freezes but found a way to mitigate for the mean time.
    Upon launching Adobe Premiere Pro, hit CTRL-ALT-DEL to launch TaskManager as well.
    You will want to highlight Adobe QT32 Server.exe
    Right click and select "End Process Tree"
    You will get considerable stability in the program, long enough to get timing of cuts done. Be sure to save often.
    If the program freezes, do not hit Save. You definitely want to avoid saving the corruption into your TimeLine
    CTRL-ALT-DEL to relaunch the TaskManager and highlight Adobe Premiere Pro.exe
    Right-click to "End Process"
    No need to reboot the whole system; just launch Premiere Pro again and continue with the session. Note that your work reverted to Last Save.
    Hope this helps until the bug is fixed.

  • Save and load public/private RSA key on file

    hi
    i'm triyng to save and load an RSA key to a file
    i generate the keys:
            KeyPairGenerator generator=null;
            KeyPair coppia=null;
            PrivateKey c_privata=null;
            PublicKey c_pubblica=null;
                generator=KeyPairGenerator.getInstance("RSA");
                //imposto la dimensione
                generator.initialize(1024);
                //genero le 2 chiavi
                coppia=generator.genKeyPair();
                //imposto la privata
                c_privata=coppia.getPrivate();
                //imposo la pubblica
                c_pubblica=coppia.getPublic();
    //i save the key
            FileOutputStream file = new FileOutputStream("key");
            file.write(c_pubblica.getEncoded());
            file.close();and then i use another program that imports the key:
       Key chiave=null;
       FileInputStream file=new FileInputStream("key");
       byte[]byte_chiave=new byte[162];
                 X509EncodedKeySpec chiave_spec = new X509EncodedKeySpec(byte_chiave);
                KeyFactory keyFactory = KeyFactory.getInstance("RSA");
                chiave = keyFactory.generatePublic(chiave_spec);but when i try to reload he key i get:
    java.security.InvalidKeyException: IOException : DER input, Integer tag error
    where am i wrong?
    thanks

    sorry...
    this is the correct code:
            Key chiave=null;
            FileInputStream file=new FileInputStream(path);
            byte[]byte_chiave=new byte[file.available()];
            System.out.println("leggo: "+file.read(byte_chiave));
            X509EncodedKeySpec chiave_spec = new X509EncodedKeySpec(byte_chiave);
            KeyFactory keyFactory = KeyFactory.getInstance("RSA");
            chiave = keyFactory.generatePublic(chiave_spec);

  • Saving and reusing adjustment layers

    Hi, I feel like what I'm trying to do should be easy, but I can't figure it out.
    I have a set of files that I'd like to apply the same set of adjustment layers to.  I opened one of the images, created the adjustment layers, and tweaked the settings until I was happy.  Now I'd like to create an action that would apply this set of layers to multiple files in batch mode.  I understand that if I were to record my adjustment layer creation, I could replay this, but I didn't record - I have a set of layers (I even saved them to a separate file) but no way to retrace my steps.  I could do all this by hand by duplicating my adjustment layer group to files that I open, but I can't find a way to automate this.  Any help?
    Thanks,
    Vladimir

    If I correctly understand your question, then my naswer is yes - you can reuse adjustment layers.  Say you have a  psd file which contains a layer with your image and several adjustment layers on top.  To  apply those same adjustment layers to other images convert the image layer to a smart object and save the file as your primary image file.  I expect the following simple sequence, which is actionable, can be put in a batch process though I've never done it as I can  manually click through images  as fast as I can hit the keys.
    The  main features of the action are  to open the primary file and right click on the smart object. From the drop down list choose Replace Contents. This brings up a Place window from which you select ( double click)  the next image and that image appears in Photoshop's main window with all adjustments applied. Click on save  and repeat the process for the next  image.
    It is rare that I need the same adjustment layers to be applied to many images- it seems that often times each image requires slightly different adjustment settings. The above process, however,  works for other operations as well, say filters (smart)  or Calculations which I may apply to multiple images.
    Paulo

  • Creation of developement class,package and access key

    COULD ANYBODY EXPLAIN about
    creation of developement class,package and access key
    and who will create them?

    Working With Development Objects
    Any component of an application program that is stored as a separate unit in the R/3 Repository is called a development object or a Repository Object. In the SAP System, all development objects that logically belong together are assigned to the same development class.
    Object Lists
    In the Object Navigator, development objects are displayed in object lists, which contain all of the elements in a development class, a program, global class, or function group.
    Object lists show not only a hierarchical overview of the development objects in a category, but also tell you how the objects are related to each other. The Object Navigator displays object lists as a tree.
    The topmost node of an object list is the development class. From here, you can navigate right down to the lowest hierarchical level of objects. If you select an object from the tree structure that itself describes an object list, the system displays just the new object list.
    For example:
    Selecting an Object List in the Object Navigator
    To select development objects, you use a selection list in the Object Navigator. This contains the following categories:
    Category
    Meaning
    Application hierarchy
    A list of all of the development classes in the SAP System. This list is arranged hierarchically by application components, component codes, and the development classes belonging to them
    Development class
    A list of all of the objects in the development class
    Program
    A list of all of the components in an ABAP program
    Function group
    A list of all of the function modules and their components that are defined within a function group
    Class
    A list of all of the components of a global class. It also lists the superclasses of the class, and all of the inherited and redefined methods of the current class.
    Internet service
    A list of all of the componentse of an Internet service:
    Service description, themes, language resources, HTML templates and MIME objects.
    When you choose an Internet service from the tree display, the Web Application Builder is started.
    See also Integrating Internet Services.
    Local objects
    A list of all of the local private objects of a user.
    Objects in this list belong to development class $TMP and are not transported. You can display both your own local private objects and those of other users. Local objects are used mostly for testing. If you want to transport a local object, you must assign it to another development class. For further information, refer to Changing Development Classes
    http://help.sap.com/saphelp_46c/helpdata/en/d1/80194b454211d189710000e8322d00/content.htm
    Creating the Main Package
    Use
    The main package is primarily a container for development objects that belong together, in that they share the same system, transport layer, and customer delivery status. However, you must store development objects in sub-packages, not in the main package itself.
    Several main packages can be grouped together to form a structure package.
    Prerequisites
    You have the authorization for the activity L0 (All Functions) using the S_DEVELOP authorization object.
    Procedure
    You create each normal package in a similar procedure to the one described below. It can then be included as a sub-package in a main package.
    To create a main package:
    1.       Open the Package Builder initial screen (SE21 or SPACKAGE).
    2.       In the Package field, enter a name for the package that complies with the tool’s Naming Conventions
    Within SAP itself, the name must begin with a letter from A to S, or from U to X.
    3.       Choose Create.
    The system displays the Create Package dialog box.
    4.       Enter the following package attributes:
    Short Text
    Application Component
    From the component hierarchy of the SAP system, choose the abbreviation for the application component to which you want to assign the new package.
    Software component
    Select an entry. The software component describes a set of development objects that can only be delivered in a single unit. You should assign all the sub-packages of the main package to this software component.
    Exception: Sub-packages that will not be delivered to customers must be assigned to the HOMEsoftware component.
    Main Package
    This checkbox appears only if you have the appropriate authorization (see Prerequisites).
    To indicate that the package is a main package, check this box.
    5.       Choose  Save.
    6.       In the dialog box that appears, assign a transport request.
    Result
    The Change package screen displays the attributes of the new package. To display the object list for the package in the Object Navigator as well, choose  from the button bar.
    You have created your main package and can now define a structure within it. Generally, you will continue by adding sub-packages to the main package. They themselves will contain the package elements you have assigned.
    See also
    Adding Sub-Packages to the Main Package
    http://help.sap.com/saphelp_nw04/helpdata/en/ea/c05d8cf01011d3964000a0c94260a5/content.htm
    access key used for change standard program.
    www.sap.service.com

  • "Save and quit" doesn't work anymore

    FF4 DOES ask me if I want to "save and quit" at the end of a session and I always click "yes" but when I bring FF up the next time NONE of my pages come up.

    You can set the warn prefs on the about:config page to true via the right-click context menu or toggle with a double left-click.
    * browser.showQuitWarning, see http://blog.zpao.com/post/3174360617/about-that-quit-dialog
    * browser.tabs.warnOnClose, see http://kb.mozillazine.org/About%3Aconfig_entries
    * browser.warnOnQuit , see http://kb.mozillazine.org/browser.warnOnQuit
    * browser.warnOnRestart , see http://kb.mozillazine.org/browser.warnOnRestart
    * browser.startup.page , seehttp://kb.mozillazine.org/browser.startup.page (1 or 2)
    To open the <i>about:config</i> page, type <b>about:config</b> in the location (address) bar and press the "<i>Enter</i>" key, just like you type the url of a website to open a website.<br />
    If you see a warning then you can confirm that you want to access that page.<br />
    * http://kb.mozillazine.org/about%3Aconfig
    You can use Firefox > History > Restore Previous Session to get back the previous session.<br />
    There is also a "Restore Previous Session" button on the default about:home Home page.
    Another possibility is to use:
    *Tools > Options > General > Startup: "When Firefox Starts": "Show my windows and tabs from last time"

  • Saving servlet html input parameters and reuse it for later time

    Dear all,
    I am using one of charting api (netcharts pro) to develop a j2ee based charting application (jsp/servlet).
    One of the requirement is to be able to capture the user input (set of selections) and save it as simple file or even save it in a database, and reuse it at later time.
    At later time user do not need to make a selection from the scratch, and user can re-select/re-open his file (or database record) and generate charts.
    in practical words :
    user can input thru request.getParameter() or reading set of parameters from file
    I will appreciate if someone can lead me to pointers/link/idea.

    Reading file is exactly the same as you do for a normal app.
    BufferedReader br = new BufferedReader(new FileReader(
                              new File("someFilePathName")));
    while(br.readLine()!= null)
        //do your stuff here
      }just put the above code into your servlet plus the relevant try,catch block. Put the blow info into your app's web.xml if you want this servlet loads once Tomcat starts.
    <servlet>
    <servlet-name>servletName</servlet-name>
    <servlet-class>servletDir</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    Hope it helps.

  • Weird Z and Y key swap and arabic filename problems in Illustrator CS3

    Hi
    I am having some very weird problems with Illustrator CS3.
    At completely random times, the software starts to think my Y and Z keys have swapped places. i.e. When I type anything or use any shortcuts, the opposite letters appear and are used.
    Also from time to time, when I save a file, the filename is written in Arabic and I have to rename the file again in Explorer to correct this.
    Both of these problems are random and a restart or Illustrator usually fixes both of these. But what a pain and waste of time.
    Anyone else getting problems like this?
    Oh, I'm using Windows Vista.
    Thanks
    Mr M

    My guess is, it is related to Windows. Try to press shift and ctrl at once if the problem occurs. The keys should be switched back...
    You have probably installed more than one keyboard in Windows. Shift-ctrl is the standard way to switch between them. You can change this in the Windows keyboard configuration file.
    I had this problem with a German and a VS keyboard installed.

  • Later - save and manage URLs to be opened later

    later is a small (242 sloc) perl script that saves and manages URLs to be opened later.
    GitHub repo
    AUR package (-git)
    dependencies
    perl
    optional dependencies (see -t command-line option)
    curl
    perl-html-parser
    command-line options
    later [options] [URL] [memo ...]
    General options:
    -h, --help print this message and exit
    -v, --version print version and exit
    -q, --quiet disable output
    -f FILE file on which to operate (default is $HOME/.later)
    Add options:
    -a append entry to FILE (default is prepend)
    -t add URL title to entry (requires curl, HTML::Parser)
    Open options:
    -o NUMBERS* open entries with given NUMBERS
    -O ENTRY open given ENTRY
    -k keep entries after opening (default is remove)
    Manipulate options:
    -l [d] list contents of FILE with numbered lines,
    descending if d is given (default is ascending)
    -r NUMBERS* remove from FILE entries with given NUMBERS
    *accepts a range of numbers separated by a hyphen (e.g. 1-9)
    example entry
    arch linux is best linux >>> Arch Linux >>> https://www.archlinux.org/ >>> Sat, 26 Jan 2013 00:04:44 EST
    potentially useful scripts
    Copy URL from clipboard and use dmenu to prompt for memo:
    #!/bin/bash
    later -q -t "$(xsel -b)" "$(dmenu -p memo: <&-)"
    Pipe file into dmenu and open selected entry:
    #!/bin/bash
    if [[ -f "$1" ]]; then
    FILE="$1"
    else
    FILE="$HOME/.later"
    fi
    later -q -O "$(dmenu -l 30 < $FILE)"
    I bind both of the above scripts to keys using my window manager of choice.
    Hopefully someone else will find this useful!

    It's a good idea that should be submitted to Apple's developers. (Submitting ideas in these forums might or might not get to the right people, while submitting feedback via Apple's forms will get channeled appropriately.)
    In a pinch, you could approximate what you're looking for by bookmarking all of your open tabs into a new folder in your bookmarks, then using the option to "Open in Tabs" when accessing that folder in the Bookmarks menu. That's certainly clumsy compared to a simple one-click "save state" method that you're requesting, but it's something....

  • Problem in Updating L.S. Configurator (CMS)i.e. Save and Update Domain Data

    Hi All,
    As i m having Sneak-Preview 2004s SR1 with SP9 and my NWDS is also having the same service pack i.e. SP9 on my local machine. And i m trying to implement the NWDI and JDI on my machine and i have done all the post installation issues as per the documents in market place. but my problem is as follows.........
    As according the tutorial in SDN, i have created the new SC and when i m trying to save and update the domain data in the Landscape Configurator i m getting the following error...
    [[><b>Unexpected error; inform your system administrator: <Localization failed: ResourceBundle='com.sap.cms.util.exception.CMSExceptionMessages', ID='SLD name-server configuration error', Arguments: []> : Can't find resource for bundle java.util.PropertyResourceBundle, key SLD name-server configuration error</b> <]]
    I think some where i have forget the some configuration can but i m not able to catch that point .....if any body knows abt this ...plz help me ..........
    Thanks
    Dheerendra Shukla

    Thanks Johan for ur reply but can u explain more abt what u want to say....???
    also one more thing as given in the post-installation guide, in the "<b>Template installer</b>" under the "Deploy and Change" section, when i try to run the DI-Post installer Template wizard i m getting the following error ....what does the mean of this error ...can any body help me out from this error ....
    ==========================================================
    <b>Element 'SAPConfigLib.J2E.Unclassified.configureCms':!BrokerImport.import_of_element_failed!!BrokerImport.Fehler!com.sap.tc.lm.ctc.cul.cpi.exceptions.CPIBaseException: <Localization failed: ResourceBundle='com.sap.tc.lm.ctc.cul.cpi.CPIResourceBundle', ID='com.sap.tc.lm.ctc.cul.cpi.BaseException_BASE_EXCEPTION', Arguments: []> : Can't find resource for bundle java.util.PropertyResourceBundle, key com.sap.tc.lm.ctc.cul.cpi.BaseException_BASE_EXCEPTION:com.sap.tc.lm.ctc.provider.javaServiceProvider.JavaServiceWriter.writeElement!BrokerImport.LINE!157-:com.sap.tc.lm.ctc.cul.broker.BrokerImport.importElement.86
    -:com.sap.tc.lm.ctc.cul.broker.BrokerImport.importElement.128
    -:com.sap.tc.lm.ctc.cul.broker.BrokerImport.importElement.128
    -:com.sap.tc.lm.ctc.cul.serviceimpl.importservice.CULConfigurationImport.importConfiguration.96
    -:com.sap.tc.lm.ctc.ccl.templateinstaller.StepExecuter.run.41
    Element 'SAPConfigLib.J2E.Unclassified.configureCms':Error during executing Java Reflection:Unable to open connection to host "pwdf3102:50100". The IP address of the host could not be resolved. Maybe the URL is misspelled or the host does no longer exist..</b>
    ==========================================================
    Thanks
    Dheerendra

  • Is anyone else having the finish rub off of the keys on their macbook? I've had mine for about 6 months and several keys look like the finish is wearing through. I went to the local genius bar today and the techs said they'd never seen this before.

    Is anyone else having the finish rub off of the keys on their macbook? I've had mine for about 6 months and several keys look like the finish is wearing through. I went to the local genius bar today and the techs said they'd never seen this before.

    Some people have seen their aluminum uni-body discoloring due to body oils.  Go figure.
    Normally putting anything over the keys/aluminum will hurt heat disspation, but you may need to use keyboard covers.
    Or save up $500/year for new keyboards.
    Neither is supposed to be a sarcastic answer.  Either one could end up being the solution.
    Good luck with it.

  • Save and delete question

    How to find out if there are other related records in another table.
    If there are other related record then delete is not allowed.
    For eample, Order has many items in it. 2 tables -Order Table and OrderItem table - one to many relationship.
    Then Can't delete a record in the order table if there are related record in the OrderItem table.
    I have 3 text fields. Enter data in it and then press the save button.
    It will save it to the database.
    how to force people to enter the data.
    That is, if they press save and if any of the 3 text fields is empty then
    show a message box saying need to fill in all text fields.
    How to find out if the text field is empty?
    How to save to multiple tables.
    That is, how to save the master table first then the detail tabes.
    For example, there is a order table and a orderItem table.
    When save button is clicked. must save to Order table first then to
    orderItem table.
    How to find out if the user is saving the data and that data already
    exists in database. So this is wrong. Can't have duplicate data.
    ----------------------------------------------

    For ur first question:
    use the transction to delete.if u found any of the conditions u mention rollback.seee the Connection class in jdbc API.normally its AtuoCommint true.so before starting transction setAutoCommit fasle.
    second question:
    in the saveButton action performed first check the textField.getText().equals("") for all the 3 textfields.if the condtions doesnt met popup optionpane.showdialog();
    if met just save it.
    3 rd question answer:
    this also same like first question.try to save in transaction.if anything happens wrong everything will be rollbacked.
    4th question:
    use unique in sql .u can set the 1 r more columns in table as unique key.
    for all these to work ur database shud support transactions....

  • "backspace", "g" and "h" keys are not working.

    hello,
    my laptop is HP 450 and windows 7.it is one years old. i haven't spilled anyting on it or damaed it in anyway i can think of.
    suddenly the "backspace" , "g" and " h " keys are not working. 
    please help me, because i have to complete my university assignment as soon as possible.
    tank you,
    shehara

    Hi,
    While this could be a hardware issue, it's always worth trying the following.
    Open windows Control Panel, open Device Manager, expand Keyboards, right click the entry 'Standard PS/2 Keyboard' and select Uninstall.
    Shutdown the notebook.
    Then unplug the AC Adapter and then remove the battery.  Hold down the Power button for 30 seconds.  Re-insert the battery and plug in the AC Adapter.
    Tap away at the esc key as you start the notebook to launch the Start-up Menu and then select f10 to enter the bios menu.  Press f9 to load the defaults ( this is sometimes f5, but the menu at the bottom will show the correct key ), use the arrow keys to select 'Yes' and hit enter.  Press f10 to save the setting and again use the arrow keys to select 'Yes' and hit enter.
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

Maybe you are looking for