Help regarding the AES cipher and engines decryptor

Hello

I'm trying to encrypt the data using the AES algorithm.

I am illegal Argument exception in the following code:

Help, please... Badly pasted.

public class AesTest  {        public static byte[] tmpIV =  //some byte[];        public static void main(String args[]) throws CryptoTokenException, CryptoUnsupportedOperationException, IOException{       InputStream encryptedInput = null;      InitializationVector iv = new InitializationVector(tmpIV);      AESKey key = new AESKey("AESTestingInProgress".getBytes());         OutputStream input = null;                              BlockEncryptor encryptor = new BlockEncryptor(                  new PKCS5FormatterEngine(                               new CBCEncryptorEngine(                                             new AESEncryptorEngine(key),iv )), input);                      byte[] buff = "ILoveMyPearl8100".getBytes();            encryptor.write(buff);                                          String toDecode =  new String(Base64OutputStream.encode( key.getData(), 0, key.getLength(), false, false));             byte[] exchangedData1 = Base64InputStream.decode(toDecode);                                     BlockDecryptor decryptor = new BlockDecryptor(                      new PKCS5UnformatterEngine(                                 new CBCDecryptorEngine(                                     new AESDecryptorEngine(key),iv )), encryptedInput);                 byte[] buffer = null;               decryptor.read(buffer);             }}

Sorry for incorrect formatting code...

Can you confirm that you continue to call read() to get the rest of the data?

I also seriously suggest using factory methods, I described above instead of your own flow of nesting.

Tags: BlackBerry Developers

Similar Questions

  • With the help of the network location and mapped a drive to the server FTP. during the transfer of very large amounts of the login information is always lost.

    With the help of the network location and mapped a drive to the server FTP off site; during the transfer of very large amounts of the login information is always lost.  Computer power settings are configured to not to do no matter what, I'm assuming that the ftp server can publish a scenerio timeout but is there a way for my computer and windows to restart the file transfer?

    Hello

    Thanks for posting your question in the Microsoft Community forums.

    I see from the description of the problem, you have a problem with networking on the FTP server.

    The question you posted would be better suited in the Technet Forums. I would post the query in the link below.

    http://social.technet.Microsoft.com/forums/en/w7itpronetworking/threads

    Hope this information helps you. If you need additional help or information on Windows, I'll be happy to help you. We, at tender Microsoft to excellence.
  • HP 15 - ac043tu: need help with the key feature and WiFi Drivers

    Hi team,

    I try to activate the key feature and WiFi in my new HP 15 - ac043tu laptop.

    I use Windows 7 Ultimate 32 operating system.

    I installed all the drivers available on the site Web of HP (http://support.hp.com/us-en/drivers/selfservice/HP-15-ac000-Notebook-PC-series/7771404/model/8326116... for my product.

    To activate the function key, I installed driver: HP System Event Utility - sp71716, but it doesn't seem to work.

    In Device Manager, network controller shows exclamation as shown below. I tried to install Broadcom and Realtek WLAN drivers, tried to turn on/off, uninstalled/reinstalled drivers referring to other positions, but that did not work.

    I also tried to install HP SoftPaq Download Manager, but it did not help. Tool does not show my product described.

    I went through a similar question posted by other members, but failed to get the solution. This question gave me hard times.

    Appreciate your help in this regard.

    Thank you

    Kishan

    Hello:

    You need these drivers wireless and bluetooth driver 64-bit file should have the 32-bit drivers too.

    Network controller (wireless card):

    FTP://FTP.HP.com/pub/SoftPaq/sp71501-72000/sp71528 .exe

    Bluetooth:

    This package contains the Broadcom bluetooth driver and software for the laptop models running a supported operating system. Broadcom Bluetooth 4.0 driver is required to activate the bluetooth 4.0 Broadcom devices and is compatible with Broadcom bluetooth 3.0 and earlier versions.

    File name: sp71440.exe

    Unfortunately, I can't help you with the next question.  The system of the event utility would be the only software I can think that would have worked.

    You can try the software HP Quick Launch, but I doubt it will work.

    http://h20565.www2.HP.com/hpsc/SWD/public/detail?swItemId=ob_112835_1

  • Need help with the OSB Assign and replace the

    I have a proxy service that receives the SOAP message:

    " < = xmlns:soapenv soapenv:Envelope ' http://schemas.xmlsoap.org/SOAP/envelope/ "xmlns:SOAP - ENC =" " http://schemas.xmlsoap.org/SOAP/encoding/ "container =" " http://www.w3.org/1999/XMLSchema ">

    " < = xmlns:soapenv soapenv:Header ' http://schemas.xmlsoap.org/SOAP/envelope/ ">

    < / soapenv:Header >

    < soapenv:Body >

    " < pidx:OrderChange pidx:transactionPurposeIndicator = 'Replace' xmlns:pidx = ' http://www.API.org/pidXML "xmlns =" http://www.API.org/pidXML "" xmlns: xsi = " http://www.w3.org/2001/XMLSchema-instance "xsi:schemaLocation="C:\shareIt\OrderChange_1-2.xsd" > ""

    ...

    < / pidx:OrderChange >

    " < = Xmlns:ocp DeliveryInformation ' http://www.digitaloilfield.com/OCP ">

    ...

    < / DeliveryInformation >

    < / soapenv:Body >

    < / soapenv:Envelope >

    I need to take the OrderChange element and place it in a SOAP body and the DeliveryInformation element and place it in the SOAP of the same SOAP message header.

    The SOAP message is then sent to a business service that makes an HTTP POST of the SOAP XML.

    I created the service of the company and he sent some data test SOAP and it works very well, but cannot create a bridge between the Proxy and the Business Service.

    In the stream of messages of Proxy I tried to do an assignment in a routing. I tried to do the following:

    1. an XQuery query transform to generate the XML SOAP just described

    2. not the entitlement where the "Expression" is the transformation and the Variable is a variable based on a schema for SOAP.

    I can see that the company is trying to be invoked, but the SOAP data does not have to be formatted or passed.

    It is the right approach or is their a better way of

    1. create the SOAP wrapped XML

    2. call the Business Service.

    Any suggestions are appreciated. I can provide more detail if necessary.

    Kind regards.

    Thank you Vlad...

    I think I'm getting in that direction now. Just do some debugging.

    Appreciate the input. I will update with final results.

    Again, your help is greatly appreciated.

    Kind regards.

  • Need help with the error message and lose internet

    c:\\Users\TheJohnsons\AppData\Roaming\d3dx9.dll

    Keep this error message and lose internet. Can someone tell me how to get rid of it? Do an internet search revealed programs for free download that I know are malware. The other message is c:\\Windows\System32\Spoolsv.exe

    Thanks in advance.

    c:\\Users\TheJohnsons\AppData\Roaming\d3dx9.dll

    Keep this error message and lose internet. Can someone tell me how to get rid of it? Do an internet search revealed programs for free download that I know are malware. The other message is c:\\Windows\System32\Spoolsv.exe

    Thanks in advance.

    Download and run the DirectX end-user running, to see if we can eliminate the d3dx9.dll message.

    http://www.Microsoft.com/en-US/Download/details.aspx?ID=35

    Regarding the message in spoolsv.exe, see thread below.

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-performance/spoolsvexe-process-is-running-all-the-time-and/8268f671-51b8-42A3-9CE8-708e9686052d

  • Need help on the regular expressions and query

    Hi guru s, I hope that you all made great!

    I have a scenario where I need to insert data into the table.

    I have three scenarios:
    select 'Kodali,Raj,S' str from dual
    union 
    select 'Alex Romano' from dual
    union 
    select 'ppppp' from dual
    
    Alex Romano
    Kodali,Raj,S
    ppppp
    What I want is now.

    1 Alex Romano
    is there space between the chain and then I want to insert in the last name and first name columns
    2 Xavier, Raj, S
    If there is a comma between the chain and I want to insert in the last name, first name and middle name
    3. If there is one channel then insert even in first name and last name.

    I wrote the request more early to manage only by commas and now I'm trying but not able to use this all scenarios
    Can you please help me.
    WITH t AS (
     
    select 'Kodali,Raj,S' str from dual
    union 
    select 'Alex Romano' from dual
    union 
    select 'ppppp' from dual
    
    ) 
    select DECODE(trim(a),NULL,'a',trim(a)),DECODE(trim(b),NULL,'b',trim(b)),decode(trim(c),NULL,'c' ,trim(c)) 
    from 
     (
      SELECT max(decode(level,1,regexp_substr(str,'[^,]+',1,level))) a --INTO lFNAME
              , max(decode(level,2,regexp_substr(str,'[^,]+',1,level))) b --INTO lLNAME
              , max(decode(level,3,regexp_substr(str,'[^,]+',1,level))) c --INTO lMNAME       
       FROM   t
      CONNECT BY regexp_substr(str,'[^,]+',1,level) IS NOT NULL
      GROUP BY str
    ) ;
    Currently I put a b and c if its null value.


    Thanks in advance!

    Hello
    You can do what you asked for in pure SQL like this:

    WITH     got_pos          AS
    (
         SELECT     str
         ,     INSTR (str, ',')     AS comma_pos
         ,     INSTR (str, ' ')     AS space_pos
         FROM     t
    )
    SELECT    str
    ,       CASE
               WHEN  comma_pos > 0
               THEN  REGEXP_SUBSTR (str, '\w+', 1, 2)
               WHEN  space_pos > 0
               THEN  SUBSTR (str, 1, space_pos - 1)
               ELSE  str
           END     AS fname
    ,       CASE
              WHEN  comma_pos > 0
              THEN  REGEXP_SUBSTR (str, '\w+', 1, 3)
              ELSE  TRIM (REGEXP_SUBSTR (str, ' \w+ '))
           END     AS mname
    ,       CASE
               WHEN  comma_pos > 0
               THEN  SUBSTR (str, 1, comma_pos - 1)
               ELSE  REGEXP_SUBSTR (str, '\w+$')
           END     AS lname
    FROM       got_pos
    ORDER BY  str
    ;
    

    But look how it is difficult, even for this simple example of data.

    I suggest you write a PL/SQL function to analyze the name. It will be much easier to deal with a combination of spaces and commas, the names of more than 3 words, etc.

  • help with the menu button and the film load

    Hi all... I am very new to flash and actionscripting and I am self-taught using mainly Internet searches.
    I'm building a site with a menu and a banner that is controlled by the menu (two swf files). I got to the make contact however, I'm stuck at this point.
    When 'bt_1' is hit I would like to be respected a "mv_1" to load in the banner.swf with intro animation... this I figured out how to... but now when you click on "bt_2" I want to play the rest of the animation of "mv_1" to unload the film before loading "mv_2" with its animation enterance respected... that I would make to several buttons. The method that I use for my local connection is...

    Sending script
    mySender = new LocalConnection();
    on (release) {}
    ------each button corresponds to a different setting... 1,2,3,4,5,6
    _root.mySender.send ("menuconnect", "action", 1);
    ------This is the best way that I could understand to disable the buttons appropriate... There might be a better way?
    Home.Enabled = false;
    couple.enabled = true;
    Events.enabled = true;
    Bridal.enabled = true;
    Media.enabled|disabled = true;
    RSVP.enabled = true;
    }



    Script of reception

    myReceiver = new LocalConnection();
    myReceiver.action = {function (doThis)}
    If (this == 1)
    gotoAndPlay (2);
    If (this == 2)
    gotoAndPlay (3);
    };
    and so and soforth for all six buttons
    myReceiver.connect ("menuconnect");

    If all this makes no sense at all, I'm sorry... I tried my best...
    If some pro out there can understand what I'm trying to do and can help me I would greatly appreciate it... Thank you all

    SJS

    I would like to use the ID to link to each of your mv_1, mv_2 etc. in the main stage and control them. This would have the advantage of eliminating the duplication of code and keeping most of your code in one place (image 1 of your _root timeline).

    If mc_1 etc was connection id mc_1ID etc, the other began on a frame labeled "outro" and ended on the last image, you can use:

  • Help with the AS3 Classes and packages

    Hello

    I'm trying to see if I can implement a function of speech synthesis in Flash. I found this post, which explains in detail how to integrate Google with Flash text-to-speech functionality. Looks pretty good, but the post seems to be written for programmers in AS3 uber-genius... Well not really, but at least those who already know how to assemble these pieces.

    I know a little about the use of the classes and packages, but do not understand how all segments of code in his position could be stitched together.

    No chance anyone can check this and give me a basic overview of how all these pieces go together? So I can try to implement myself...

    http://blog.onebyonedesign.com/ActionScript/Googles-text-to-speech-engine-in-Flash/

    Thank you very much in advance!

    Elliott

    PS. also open to an alternative to speech in Flash, if you know a easier... Thank you!!

    Here's a link to something that might be useful for you as well as to learn how to work with custom classes.  I don't think I've ever seen of it, but it was mentioned in another of tutorials from Lee that I watch and that it helped me anyway.

    http://gotoandlearn.com/play.php?id=30

    Insofar as the page you will bound, that third largest section of the code (the class named hand) is basically what you want to use for any Flash file you have on your page that provides the interface text/speech.  Then you would copy to a file named "Main.as" you have in the same folder as your swf file and use it as your document class.  The document class is specified in the properties of your fla Panel.

    One thing about this file, it's that I can't import the file "GTextToSpeech.as" that he uses.  So, you may need to add as an import at the beginning of your Main.as file.  The file GTextToSpeech.as is it that you would name the file you create using the first section of the code on this page.

    This small second section of the code, this is what you will place in a php file.  According to the file Main.as name this php file should be "proxy.php".  This file must be in the same folder as the html page that loads the swf file.

  • Please help with the extended search and replace

    Thanks in advance to dedicate time to help.

    Why does this work?

    Find: jpg ">"

    "Replace: jpg" alt = "" >

    Parameters:

    Current document

    Text (Advanced)

    Inside of the tag (img selected) and I tried to not inside tag

    All the option boxes unchecked

    Click on replace all

    And nothing is found or replaced but there are many of them.

    I live and die by that in Homesite then please help me understand this so I must not have market Homesite too. I like it very much because such simple things makes me batty.

    You do this in the following parameters:

    Parameters:

    Current document

    Source code (and not text)

    Inside of the tag (img selected) and I tried to not inside tag

    All the option boxes unchecked

    Kind regards

    Vinay

  • BlackBerry Z10 need help with the facebook chat and notifications

    Hey, guys.

    Since I updated to version 10.2.1.2102 of the software I was not able to receive messages from the hub of blackberry facebook chat. Before the update whenever I had my phone connected to a wireless network it was automatically getting messages facebook on the hub. Now, although I can send messages and receive messages if this contact is online, once I close the conversation hub is gone and I don't get the messages, only the "new messages of * person *" e-mail after a certain time.

    In addition, I don't get notifications about birthdays of the people. I get the "next event" x hours notification on the lock screen, if I go in the calendar I see the notification at the top of the page, but it does not sound to warn me of my birthdays from the contacts.

    Can someone help me with this two problems? Thank you!

    Fact. I needed to update the facebook app.

  • Need help regarding the extension of the media...

    Hello

    I have a sequence of still images and text above.

    I would like to extend the images and text. If I drag the end of a picture, that nothing is happening, probably because there is no room left, so I guess I have to switch from somehow to push each other instead of overwriting.

    Could someone help me out here?

    Thank you

    Ulf

    Select them... Right Click (Menu) and change the duration with ripple.

  • help with the new laptop and elements...

    Hi all...

    I recently bought a copy of 11 items to the disc. I love the program and learn to use it. Here's my dilemma, as I bought the program, I decided to upgrade my laptop.  Currently I am working on a laptop that has a cd/dvd rom. my new laptop with Windows 7 will probably not a cd/dvd drive. My question is... are at - there a way to download my current copy of items on the new hard drive when I don't have a cd/dvd player or do I have to buy a new copy?  The answer will determine what kind of computer, I find myself with. Also, what processor recommend everybody to work with photoediting?

    Thanks for all your help!

    ~ Nancy

    There are resources available for the download items 11 on your new machine.  You will only need to have the serial number of the disc you purchased to activate the software to use fully.

    The Adobe site:

    http://www.Adobe.com/cfusion/TDRC/index.cfm?product=photoshop_elements&loc=us

    A support site:

    You can download the demo version of the software through the page linked below and then use your current serial number to activate it.

    Don't forget to follow the steps described in the Note: very important article Instructions on the pages to download to this site or the download may not work properly.

    Photoshop/Premiere Elements 11:

    l http://prodesigntools.com/Photoshop-Elements-11-Direct-Download-Links-PSE-Premiere-pre.htm

  • Help on the preview video and burn

    I used Prime Elements 8 for awhile with no difficultty and now uses the first Pro CS5. My work in first Pro CS5 shows well in the monitor window, but whenever I do a dynamic link to still my work just appears in a window that is much smaller than the size of the screen.  OK, what don't get me?  Any help appreciated.

    Welcome to the forum.

    When there is such incompatibility, it is usually because of source footage in PrPro does not match the predefined project one. Can you give us the complete specifications. each source footage and the PrPro project preset.

    Good luck

    Hunt

  • A few questions regarding the hardware upgrade and the games on Satellite Pro 2100

    Hey,.

    I thought that posting this here because it's more about the lines for the games I could think on another topic.

    I'll get to the point... Basically, I bought a laptop from a guy that my friend knew. He barely used this laptop and didn't know anything about computers, and he tried to avoid as much as possible. So he got rid of this laptop for me for real cheap.

    Now I got it, I had expected either of two things with the laptop.

    (1) what I'll use it so I can sit in his bed and travel a little bit while having files, movies, music and internet access. (it wasn't my main idea)

    Or

    (2) it allows to play video games on it, or to update, so I have a better chance to do so.

    I was hoping to get for video games, mainly for my brother to use because his computer is lagging a lot while playing world of Warcraft. I was hoping that this notebook would give him a better experience for a while.

    But as I was installing the game on this, I noticed that the disk space is low, so I'm going to buy an external hard drive, so I can send files between the PC and the laptop, and I got an error message saying that the RAM was under "minimum requirements" for WoW.

    So I know that I got to level it with something big, but I know not what, so I'm not quite sure that this laptop will run the game at a decent rate. So I thought that I turn to a computer forum and ask.

    It's my laptop;
    [Satellite Pro 2100 PS210E | http://uk.computers.toshiba-europe.com/innovation/jsp/SUPPORTSECTION/discontinuedProductPage.do?service=UK&BV_UseBVCook = Yes & PRODUCT_ID = 45659 ie]

    This laptop will do the job don't you think?
    Or it will be better for simpler things, or less if I had the ram to 1gig?

    I don't know much on the laptop, and I'm not really willing to spend too much on fixing, if it's just a change of the ram, then it wouldn't cost much for than to upgrade around 1gig.

    Hello

    First of all, I must say that this notebook belongs to an older series laptop.
    It was equipped with the 1.8 Celeron CPU, 256 MB RAM, 20 GB or 30 GB HARD drive and a 16MB graphics card internal.

    What you can do is upgrade the RAM up to 1 GB (2 x 512 MB) and the HARD drive. But I think that the maximum size of HARD drive that would be recognized by the BIOS is 120 GB.
    I think that the laptop supports one IDE controller and it limited because of the 28-bit LBA HARD drive size.

    So finally, it is important to mention that you can not pass the graphics card because it s soldered onto the motherboard. Upgrading the CPU is not possible or very difficult.

    I come to the conclusion that you will not be able to play games of new generation on this machine. The hardware specs are maybe too low a few simple games would run on this laptop but I'm sure that other newer games will not run smoothly.

    Welcome them

  • Re: Satellite A500 - need help with the FN key and Toshiba programs

    Hello

    The fn key Eco and other buttons specialized such as the one that opens Windows Media Player have stopped responding on my PSAM3A-03P00E A500 running Windows Vista. I can always change the brightness of the screen with the FN key, but no menu appears at the top of the screen.

    Also Toshiba programs that are intended to be run at the start as PC Health Monitor are not auto start, even if they are enabled in the Configuration (msconfig) system.
    The Bluetooth Manager however initially runs upward.

    I have blue screen errors, but they are not a problem since I have updated the BIOS to 1.5 and uninstalled Zonealarms.

    See you soon

    Hello

    Try reinstalling the additional package of Toshiba. AFAIK, this utility is responsible for these functions.

Maybe you are looking for