How to make all characters of a 3DES encrypted string printable

I am performing a triple DES on a string, and when I print out the encrypted data, it is 'chopping' off a character on the terminal.
For instance, I run the encrpytion ona string "blah", and print out the results:
java Test3Des blah
OUTPUT = ?$O4|
The problem here is that the string should have a "|" at the beginning of the output, not only the end. So I am not sure how I can 'pad' the output so that it can be saved to a file, and not remove characters around it in such a way that I can read it back in and decrypt to get "blah" back.
Thank you for the help....

Your encrypted bytes have all the information you need, what you need is to convert those bytes with a Base64 encoding class before you print them to the output. You don't need to do this before writing to a file, but it is best as them you don't have any problems with the Unicode only behavior of some of the InputStream subclasses. You didn't mention any JCE provider, but BouncyCastle offers a Base64 class as part of their implementation.
Another caveat, make sure to always specify the formatting when making String objects and writing to a file, etc., etc. I prefer "UTF-8" for it.

Similar Messages

  • I have added a 5 songs from a single album and in Ipod it comes as enigma album and in that one song is available and another album named enigma and another song. IT happens for 5 songs also. How to make all the 5 songs in one album name Enigma

    I have added a 5 songs from a single album and in Ipod it comes as enigma album and in that one song is available and another album named enigma and another song. IT happens for 5 songs also. How to make all the 5 songs in one album name Enigma???

    I am working on a friend of mine's 15g ipod(W/dock connector)and I am having the same trouble except it does it to all the songs. I have tried reseting it multiple times, but to no avail.
    I am not sure that this runs on windows XP, it is absolutly archaic (compared to my 5th gen. 30g video).
    Help?
    15g ipod (w/dock connector)   Windows XP  
      Windows XP  

  • How to make all fields mandatory in sales order T- code VA01 initial screen

    Dear all,
    how to make all fields mandatory in sales order T- code VA01 initial screen itself
    The fields are
    Sales Organization
    Distribution Channel
    Division
    Sales Office
    Sales Group
    Regards,
    Amar Reddy

    Hi,
    You can use Transaction Variant to achieve this functionality.Please go through the following link which helps you in creating the same.
    [Link|http://wiki.sdn.sap.com/wiki/display/Snippets/TransactionVariant-AStepbyStepGuidefor+Creation]
    Regards,
    Phani Prasad

  • How to make all nodes in a detailed navigation tree open automatically??

    Dear All,
    I have added some iViews to two folders and add these two folders to a workset "Time" and then add "Time" to the role of Employee portal user.
    How to make all nodes expanded automatically when this workset is clicked in EP??
    thanks,
    Zita

    Not surprising...it does not work even if you follow the exact way...
    Role ->
             Workset 1
                          -> Page 1
                          -> Workset 2
                                           -> Page 2
                          -> Workset 3
                                           -> Page 3
    When the user clicks on Role which is the Entry Point, I want the user to see Page1 (works alright) and want the tree node Workset 2 open (doesn't work)...I want tree node Workset 3 closed (which is what happens...)
    The thing is Workset 2 has to be open...
    This is what I've done...I've made the Initial State of Navigation Panel set to "Open"...
    What else is to be done????
    Thanks a lot.
    JP

  • How to make all settings default?

    how to make all settings default?

    What specific settings are you alluding to?  More details please.
    Ciao.

  • How to make all the rows editable in webdynpro alv output

    Hi,
    How to make all the rows editable in webdynpro alv output.
    Thanks
    Rakshar

    Hi Rakshar,
    Check this wiki:
    http://wiki.sdn.sap.com/wiki/display/WDABAP/HowtoeditconditionallyrowofaALVtableinWebDynprofor+ABAP
    Regards

  • How to make all text in a pdf accessible

    I want to copy text from a scanned in .pdf to a Word document. Some is able to be copied but other text isn't. How do I make it all able to be copied?

    Until the scanned image of text that is in a PDF has OCR applied there is only a picture / an image - there is no text.
    Post OCR there are characters available for those images of characters that are recognized.
    Not all characters are always recognized.
    What is recognized / captured can be copied and pasted, can be exported / saved as to TXT, RTF, DOC, DOCX.
    Sometimes a scanned image with OCR results in pretty darn good content from OCR that results in pretty good export.
    BUT - anything scanned is a "sow's ear" & a silk purse (export to Word needing little to no remediation) cannot be made from a sow's ear.
    Be well...

  • How to force all characters in prompt text field will be in uppercase???

    Hi everybody
    How to get that all characters in a prompt field of a Webi report will be compared in uppercase with the database field ?? Even if the user input text in lower case.
    this is due to the database all filelds are in uppercase, and avoid to say to the users they input fileds in uppercase.
    i looked for a parameter in a universe and in oracle.prm filed, and i didn´t find it.
    Thanks in advance
    Guillermo
    DB: ORACLE 10G
    BO: XI r2

    Thanks a lot rohy.
    now i use that solution, but my intention is try to solve to all objects, not each object individualy, due to i have a lot of objects that a user can choose from a prompt, and i have a lot of filters to do that
    i would like to change some parameter to do that at one time.
    i investigate about it......
    thanks again.
    best regards Guillermo
    have a nice day

  • How to make all Button component instances trigger rollOver sound?

    Hello all--
    I am using the Button component (the one shipped with CS3) in
    many places in my AS3 project. I am coding in .as files, not on the
    timeline.
    I have skinned the Button to use the colors I like. Now I
    wish to "skin" it so that all instances generate a rollOver sound,
    and I'll be darned if I can figure out how.
    I know I can listen for ROLL_OVER events in each Button
    instance. But I have many many Buttons and it seems kludgy to add
    that same code to every class I have which tracks a Button. I am
    hoping there is some way I can make *all* instances of Button
    respond to rollOver the same way. I am hoping it is like
    setComponentStyle or changing the skin for the Button; I can do it
    in one place and it works everywhere.
    I guess I can listen on the Stage level for bubble-ups of
    ROLL_OVER, trap those that come from Button instances, and handle
    it from there, but stagewide listeners also seem a tad kludgy.
    Is there some elegant way to make all my Buttons
    automagically generate the same rollOver sound?
    Many thanks,
    Matthew Ford

    It's regrettable there is no reply. But in case someone comes
    across this topic, FYI I put on my main View class (to which all
    other views and GUI are childed) an
    addEventListener(MouseEvent.MOUSE_OVER...). The MOUSE_OVER events
    bubble up to that.
    Then in the listener function I see if the event.target is
    Button. If it is, I trigger the sound.
    Curiously, the supposedly better ROLL_OVER event did not
    bubble up predictably. Sometimes it did and sometimes it did not.
    But the docs say that event is not supposed to bubble for some
    reason.
    I still think there is a better way and I'd like to hear it.
    Maybe I just need to make my own clone and adaptation of the
    Button, but I am not experienced yet with creating components
    (SWCs) and it appears that simply overriding the Button class with
    my own .as file does not work-- the rollOver functions report
    errors that they cannot be overridden.

  • How to make all hyperlinks in my document inactive, like you could in the old pages under link inspector

    In the pages 09 one could click inspector and the link inspector had a box, make all links inactive.  Where is this in the new pages?  It is needed for School papers. and editing. 
    Thx

    Hi Hans,
    Doesn´t anyone no a way to, at least, avoid getting automatic-underlined-coloured links?
    Try this:
    Untick Smart Links.
    Regards,
    Ian.

  • How to make all rules active in Mail

    Every time I sync my MacBook with my IMac through Mobile Me, the rule sync OK but it deactivate my rules. I have to click on every single one again to make them active. Is there a faster way to make all the rules active at once. TIA.

    Make them active then re-sync. You are obviously updating from the old saved information not the new. If that doesn't work, then remove your computer from the authorized sync list and start fresh. You can then copy all your information FROM the computer to MobileMe.

  • How to make all the rows of a table editable

    I have a table in a view, with visibileRowCount property as 5. The internal table which is bound to the context has 2 rows.
    I want to make all the 5 rows of this table as editable. As of now, as there are just 2 rows in the internal table, only the first 2 rows of the table in the view are editable.
    My idea is to avoid the use of a 'Add row' button for this table. Is it possible to do this?
    Points will be rewarded. thanks.

    hi john....
                just insert 3 more empty records into your internal table... so it becomes editable.
    ---regards,
       alexb justin

  • How to make "all day" the default in calendar ?

    Is there a way to make "all day" the default appointment time in calendar?
    Thanks

    To my knowledge, no.
    Barry

  • How to Make All Events in One Calendar Have Alerts Automatically

    I am a college student majoring in engineering, which means I always have lots of homework due at various times. So to help me keep better track of when my assignments are due, I have started putting the due dates into my calendar. The only problem with that is every time I enter in a new event I have to set up an alert for that particular event. This is extremely annoying having to do this for each assignment. What I am wondering is there a way to make it so that every event in my "Homework" Calendar sends me an alert two hours before the event starts? I know you can make it so that all events send you an alert, but I just want this one calendar to automatically send alerts for it's events. Any help is greatly appreciated!

    Thread is closed.
    'Twas simple, but problem was my lack of knowledge how winhelp is built.
    I needed to Update (synchronizae) document after I linked it and built proper topics and link them with proper document section.

  • How to make all "allowed" clients visible at the log on/welcome screen at start of the computer

    Assuming this is controlled by the Active Directory Server 2012 R2..
    I allow 3 users to be able to log on to computer A.
    I now start computer A. At the welcome / start screen I only see the person who was logged on latest.
    However, it would be great to see which 3 users actually can log on to that computer, have their user pic and names
    on the welcome / start screen instead of the "latest logged on" and then click on the person you are to log on.
    How do I configure the Server 2012 R2, or Client computer, so they won't see last person logged on, but simply everyone
    who actually is able to log on?

    You are not going to be able to do this on a domain computer. You can disable the last logged on user prompt though. This would make the computer prompt for a username at all times. That group policy setting is called: Interactive logon: Do not display
    last user name and is available under Computer Configuration\Policies\Windows Settings\Security Settings\Local Policies\Security Options.
    If my answer helped you, check out my blog:
    Deploy Happiness

Maybe you are looking for

  • Oracle 9iLite download setup.exe file does not work

    Like many people (I am discovering more by the minute), I am unable to install 9i Lite.5.01. When the setup.exe file is triggered, a hourglass appears for a second, then nothing... I am installing on a windows 2000 terminal server, therefore I have t

  • Really low volume on headphones with iPad mini iOS 8.2

    Hello, Problem is with an iPad mini running iOS 8.2. When I connect any headphone/earbud to my iPad mini I can't hear a thing. Actually the sound is not totally muted but really really really low, almost imperceptible. The headphones are fine -tried

  • Sending an email when order is placed

    I need to send an email notifying the website owner whenever an order is placed. What would be the best option? And how would this be done? ASP/VBScript SQL Server 2005

  • Creation of Dispute Case in FI-CA

    Hello, Anyone provide me insight for: Creation of Dispute Case - As per SAP Standard functionaliy we can create the Dispute Case from FPL9/FPE2 and UDM_DISPUTE Problem 1 : I am facing a problem to create dispute case from transaction UDM_DISPUTE for

  • TS1368 No search results displays in iTunes

    I go to the iTunes app and type in a search for an artist or song for music, and nothing is ever displayed.  The screen stays white and nothing appears.