Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2012
    Posts
    1
    Rep Power
    0

    Default Converting String to byte array

    Hi there,

    Is there a way to convert a String to a byte array? See example below.

    FROM:
    String _salt = "itsmysecret";

    TO:
    byte[] _bSalt = {'i', 't', 's', 'm', 'y', 's', 'e', 'c', 'r', 'e', 't'};

    It will be used to encrypt and decrypt passwords. Each password have it's own salt value.

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    19

    Default Re: Converting String to byte array

    You could always have a look in the API.
    Please do not ask for code as refusal often offends.

Similar Threads

  1. CONVERTING BYTE ARRAY to STRING
    By Sukeshps in forum New To Java
    Replies: 5
    Last Post: 01-18-2012, 06:08 PM
  2. Replies: 6
    Last Post: 02-17-2011, 01:22 PM
  3. Converting string to byte[]
    By bobo67 in forum New To Java
    Replies: 12
    Last Post: 09-10-2010, 09:10 PM
  4. Need help converting int to a 4 byte array
    By kook04 in forum Advanced Java
    Replies: 5
    Last Post: 02-26-2010, 08:59 PM
  5. Converting Image to byte array[] ?
    By afflictedd2 in forum CLDC and MIDP
    Replies: 0
    Last Post: 04-11-2009, 11:33 PM

Tags for this Thread

Posting Permissions

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