Results 1 to 12 of 12
Like Tree1Likes
  • 1 Post By JosAH

Thread: Is there any way to encrypt executable JAR file?

  1. #1
    basfot is offline Member
    Join Date
    Feb 2012
    Posts
    16
    Rep Power
    0

    Default Is there any way to encrypt executable JAR file?

    In JAR file I have source code e.g.

    datasource.driver=com.mysql.jdbc.Driver
    datasource.url=jdbc:mysql://localhost/reportsdb
    datasource.username=reportsUser
    datasource.password=password

    I need, that some user don't get value: reportsUser and password. I would like use only client part and DB and user can update or delete in DB, therefore I need hide important source code. Thanks. Is there any way to encrypt executable JAR file?
    Last edited by basfot; 02-28-2012 at 01:30 PM.

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,589
    Rep Power
    23

    Default Re: Is there any way to encrypt executable JAR file?

    In JAR file I have source code
    Why are you putting the source code in a jar file?

    Even If the password etc are encrypted, a knowledgeable user can still get their values by decompiling the code and using it to decrypt the encrypted password from the file. You can only make it more difficult for most users, but never impossible.

  3. #3
    basfot is offline Member
    Join Date
    Feb 2012
    Posts
    16
    Rep Power
    0

    Default Re: Is there any way to encrypt executable JAR file?

    No, I thought, that this values in somewhere in java code as String password = "pass"; etc. And when some user decrypting class file, so I would like to prevent this, if it is possible.

  4. #4
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,589
    Rep Power
    23

    Default Re: Is there any way to encrypt executable JAR file?

    If the user has the code, he can extract parts of it, build a new program, execute it and decrypt the password.
    You can only make it more difficult, never impossible.

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

    Default Re: Is there any way to encrypt executable JAR file?

    Why are you connecting directly to the db through your client?
    If you're doing that then give each user an account on the db and then make them log on.
    Please do not ask for code as refusal often offends.

  6. #6
    basfot is offline Member
    Join Date
    Feb 2012
    Posts
    16
    Rep Power
    0

    Default Re: Is there any way to encrypt executable JAR file?

    I want to have application and communication with minimum time. And users can be a lot of. In db I have table of users, and for each user I have to create new account in db a this isn't good solution. :-(

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

    Default Re: Is there any way to encrypt executable JAR file?

    The "single database user" style is only really relevant to the webapp environment, with any number of potential users.
    It's not (in my mind) all that valid for a desktop environment where you are talking dozens at best.
    If it's more than dozens, or potentially involves opening your db to the internet, then it should be a web service or webapp.
    Please do not ask for code as refusal often offends.

  8. #8
    Join Date
    Feb 2012
    Location
    Delhi, India
    Posts
    5
    Rep Power
    0

    Default Re: Is there any way to encrypt executable JAR file?

    Looking at ur requirement, i can suggest u a work around.. encrypt the file which has USER name and password using your own encryption key. Example - original password is "abc", the password displayed to user is one character plus to each alphabet "def". Now u have encrypted it... decryption key for it u can provide to users u want to have original username and password. I dont know how to encrypt jar file but now u can place these changed files in executable jar file and remake your jar file.
    One more thing, to make the this job easy, get username and password read from a properties file, then making changes will be much easy.... Just an idea.. :)

  9. #9
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,083
    Rep Power
    4

    Default Re: Is there any way to encrypt executable JAR file?

    But that's a commercial product. You're not advertising are you?

  10. #10
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default Re: Is there any way to encrypt executable JAR file?

    No, he'd probably just missed that this is a zombie ;)
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  11. #11
    Toll's Avatar
    Toll is offline Senior Member
    Join Date
    May 2011
    Location
    Sweden
    Posts
    382
    Rep Power
    3

    Default Re: Is there any way to encrypt executable JAR file?

    Yes... two days in a row. He made a similar post yesterday. Doesn't exactly make me want to buy that product :P

  12. #12
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,007
    Blog Entries
    7
    Rep Power
    20

    Default Re: Is there any way to encrypt executable JAR file?

    Please walk on folks, nothing to see here; I moved the post to rhe Reviews/Advertising section.

    kind regards,

    Jos
    DarrylBurke likes this.
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. create windows executable using executable jar file
    By sarwar1234 in forum New To Java
    Replies: 2
    Last Post: 02-07-2011, 08:29 PM
  2. Executable jar file
    By franklyn@bellsouth.net in forum New To Java
    Replies: 12
    Last Post: 08-26-2010, 01:03 PM
  3. Executable File.
    By BeeGee in forum Advanced Java
    Replies: 13
    Last Post: 05-25-2010, 12:35 PM
  4. How to Encrypt content of txt file?
    By aRTx in forum New To Java
    Replies: 0
    Last Post: 03-25-2009, 10:26 AM
  5. Executable Jar File Creation
    By Doctor Cactus in forum New To Java
    Replies: 7
    Last Post: 11-13-2008, 03:31 AM

Posting Permissions

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