×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Aug 2008
    Posts
    6

    encrypting string, RSA using boucy

    ok i kinde see i cant get rid of any files but im getting a strage error
    this is my code
    byte[] password = (m_display.queryString(TextField.PASSWORD)).getBytes();
    AsymmetricBlockCipher rsaCiph;
    RSAKeyParameters pubKey = new RSAKeyParameters(false,new BigInteger(rsaKey.m_modulus),new BigInteger(rsaKey.m_exponent));
    try{
    rsaCiph.init(true, pubKey);
    byte[] cipherText = rsaCiph.processBlock(password, 0, password.length);
    } catch(InvalidCipherTextException e) {
    e.printStackTrace();
    } catch(DataLengthException e){
    e.printStackTrace();
    }
    and this is the error
    rsaCiph.init(true, pubKey);
    Note: Some input files use or override a deprecated API.
    any one knows whats that about?
    Last edited by matan_d; 2008-10-22 at 17:19.

  2. #2
    Registered User
    Join Date
    Aug 2008
    Posts
    6

    Re: encrypting string, RSA using boucy

    OK ill be more organized i just worked on it all day
    i have a server client application(server is c++)
    the server sends a public key (mod and exponent) as big endian integers
    i take them to byte arrays work the bouncy castle charm and send it back (like in code)
    after decryption i see something which isn't even similar to the password can you guys see any thing wrong i'm doing in the code
    maybe in creating the BigInteger, in the server i use BN_bn2bin on the mod and exponent and eventually i send the unsigned big endian integer with the size
    Code:
    AsymmetricBlockCipher rsaCiph = new RSAEngine();
                    RSAKeyParameters pubKey = new RSAKeyParameters(false,new BigInteger(1,rsaKey.m_modulus),new BigInteger(1,rsaKey.m_exponent));
                    rsaCiph = new PKCS1Encoding(rsaCiph);
                    rsaCiph.init(true, pubKey);
    byte[] password = (m_display.queryString(TextField.PASSWORD, "Enter Server Password:")).getBytes();
                        if(password==null){
                            return;
                        }
                        try {           
                            byte[] cipherText = rsaCiph.processBlock(password, 0, password.length);
                            m_proto.sendPassword(cipherText, cipherText.length);
                        } catch(InvalidCipherTextException e){
                            e.printStackTrace();
                            m_display.messageBox("Error", "Couldn't Encrypt Password\nAborting");
                            return;
                        }
    Last edited by matan_d; 2008-10-23 at 17:30.

Similar Threads

  1. Send string data from symbian to .net
    By ahlmans in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2008-01-16, 13:40
  2. How to use Gauge/Process Bar when using HttpConnection?
    By Tanya in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2006-12-28, 07:59
  3. global root overflow(please help)
    By sushant_125 in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2004-05-14, 08:24
  4. Personal
    By JSmith77 in forum PersonalJava
    Replies: 4
    Last Post: 2003-07-30, 12:52
  5. D211 new linux driver 1.04 not working !!
    By franz_meyer in forum Multimodecards
    Replies: 1
    Last Post: 2002-12-12, 08:31

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •