Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7646631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:15:31+00:00 2026-05-31T10:15:31+00:00

I have written a BlackBerry app that uses AES encryption. I am trying to

  • 0

I have written a BlackBerry app that uses AES encryption. I am trying to decrypt this using the AesCryptoServiceProvider in C#.

The BlackBerry code doesn’t seem to use an IV which means I have nothing to pass to the AesCryptoServiceProvider.

Is it possible for me to decrypt AES without an IV, if so, how?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T10:15:32+00:00Added an answer on May 31, 2026 at 10:15 am

    Reading the blackberry java crypto documentation, it appears you are not supposed to directly use AESEncryptionEngine. If you use it straight, you end up with ( I assume) ECB mode which results in the following encryption of an image of a penguin. don’t do it.

    Bad Encryption
    Rather it appears that to use some secure mode of operation, you need to actually use a wrapper around the basic AESEncrypt / Decrypt Engine. You want to use the CBCEncryptionEngine to do this. Here is some sample code from here. Note that the IV is randomized on creation, so you don’t need to set it or worry about reuse. Just replace DES with AES here.

    // sampleDESCBCEncryption
    private static int sampleDESCBCEncryption( 
        byte[] secretKey, byte[] initVector, byte[] plainText, byte[] cipherText, int
        dataLength ) 
        throws CryptoException, IOException
    {
        // Create a new DES key based on the 8 bytes in the secretKey array
        DESKey key = new DESKey( secretKey );
    
        // Create a new initialization vector using the 8 bytes in initVector
        InitializationVector iv = new InitializationVector( initVector );
    
        // Create a new byte array output stream for use in encryption
        NoCopyByteArrayOutputStream out = new NoCopyByteArrayOutputStream();
    
        // Create a new instance of a BlockEncryptor passing in an instance of a CBC encryptor engine
        // (containing an instance of a DES encryptor engine), the initialization vector, and the
        // output stream
        BlockEncryptor cryptoStream = new BlockEncryptor( 
            new CBCEncryptorEngine( new DESEncryptorEngine( key ), iv ), out );
    
        // Write dataLength bytes from plainText to the CFB encryptor stream
        cryptoStream.write( plainText, 0, dataLength );
        cryptoStream.close();
    
        // Now copy the encrypted bytes from out into cipherText and return the length
        int finalLength = out.size();
        System.arraycopy( out.getByteArray(), 0, cipherText, 0, finalLength );
        return finalLength;
    }    
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a BlackBerry app that RSA encrypts a message using PKCS1FormatterEngine. This
I have a simple BlackBerry app i'm working on that uses JSONP and Zepto.js.
I have written a DLL that uses MS Word to spell check the content
I have written something that uses the following includes: #include <math.h> #include <time.h> #include
I have written the following code. I know that a higher order function is
I have written an Android app (target 3.2) using Eclipse 3.7, I tried to
We have an Android/Blackberry project with a common part. That part, obviously, is written
Have written all the code in a silverlight class library (dll) and linked this
I have an Blackberry library written using JAVA as well Blackberry(RIM) specific API's. I
I have written a app in PHP on my localhost server using XAMP, which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.