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

  • SEARCH
  • Home
  • 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 7996295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:40:35+00:00 2026-06-04T14:40:35+00:00

I am making an application in blackberry. In that application i want to encrypt

  • 0

I am making an application in blackberry. In that application i want to encrypt a string using AES algorithm. Is it possible to use AES algorithm in Blackberry? Is there any API for that? Thanks in advance,

  • 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-06-04T14:40:37+00:00Added an answer on June 4, 2026 at 2:40 pm

    try this –

    useremail= CryptAes.AESEncryption(username_.getBytes());
    

    CryptAes class is given below –

    public class CryptAes {
    // First create the AES key based on the bytes in secretKey using  keyLength bits as the length
    static AESKey keydec = new AESKey("A3$1E*81234567891111111111111111".getBytes() );
    static AESKey keyenc = new AESKey("A3$1E*81234567891111111111111111".getBytes() );
    static AESKey keyenc128 = new AESKey("A3Q1EF8123456789".getBytes());
    static AESKey keydec128 = new AESKey("A3Q1EF8123456789".getBytes());
    
    private static byte[] iv = { 0x0a, 0x01, 0x02, 0x03, 0x04, 0x0b, 0x0c,
        0x0d, 0x0a, 0x01, 0x02, 0x03, 0x04, 0x0b, 0x0c, 0x0d };
    
    public static byte[] plainText= new byte[10000];
    
    public static String AESEncryption(byte[] plainText) throws CryptoException, IOException {
          AESEncryptorEngine engine = new AESEncryptorEngine( keyenc128 );
          CBCEncryptorEngine cengine=new CBCEncryptorEngine(engine, new InitializationVector(iv));
          PKCS5FormatterEngine fengine = new PKCS5FormatterEngine( engine );
          ByteArrayOutputStream output = new ByteArrayOutputStream();
          BlockEncryptor encryptor = new BlockEncryptor( fengine, output );
    
          encryptor.write(plainText);
          encryptor.close();
          byte[] encryptedData = output.toByteArray(); output.close();
          String st=new String(encryptedData);
    
          byte[] base64 = Base64OutputStream.encode(encryptedData, 0, encryptedData.length, false, false);
    
            //Base64Coder.encodeString(Byte.toString(plainText));
            String str = new String(base64);
    
       return str;
    }
    
    
    // sampleAESDecryption
    public static String AESDecryption(byte[] cipherText, int dataLength ) throws CryptoException, IOException {
    
        // Create the input stream based on the ciphertext
        ByteArrayInputStream in = new ByteArrayInputStream( cipherText, 0, dataLength );
    
        // Now create the block decryptor and pass in a new instance
        // of an AES decryptor engine with the specified block length
        BlockDecryptor cryptoStream = new BlockDecryptor(new AESDecryptorEngine( keydec128 ), in );
    
        byte[] T= new byte[dataLength];
        // Read the decrypted text from the AES decryptor stream and
        // return the actual length read
    
        int length= cryptoStream.read( T );
      String str= new String(T);
    
      int i=str.indexOf("</msg>");
      str=str.substring(0,i+6);
      return str;
    }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making an application in Silverlight 3.0. In that application i am using
I am making the following call in my blackberry application (API ver 4.5)... public
I'm making an application with wxWidgets that has a listbox in it. I want
i am making application in c#.In that application i am using Code as private
Im making an application that uses of API-threads in C, The program takes N-files
I'm developing a blackberry webworks application using sencha touch . And after making build
I'm making application. I am using JQuery, that retrieves data from MySQL database using
I am making application in c#. In that application i want to create the
Is it possible and is there such a practice? I am making an application
i am making application in c#. In that implication i have string which contain

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.