How to hide the password in .class file?

Hi All,
I try to use a Connect.java file to connect to MySQL. The URL is similar to the following:
"jdbc:mysql://192.168.1.1/database?user=name&password=123456"
When I compile the .java file to a .class file, I can still see the full URL line in the machine codes of the Connect.class file.
How to avoid exposing the password in the line?
Thank you.
Anthony Pong

1) Use obfuscate option in your Java compiler
2) There is Jakarta tool BCEL - which can be used for
obfuscation, etcObfuscation tools don't obfuscate single literal string contents, which is the problem here.
You'll have to make sure that your string doesn't appear as a single string anywhere. One technique is to break up your password into pieces, and scatter the declarations around, and join them up in the code to construct your password.
(Oh yeah, and don't call your variables "static private final String passwordPiece1="foo";" either :-), or use an obfuscation tool to hide these variable names).

Similar Messages

  • How to hide the password's list from the Tools - Options - Passwords

    Hi I am an IT in a experimental school and we work 99% online with the teacher & students in the class.
    My boss need to '''hide''' from the teachers the option to see the stored password for thousands subscription sites that my boss have pay.
    It their any way that we can hide / remove the option to see the stored passwords.
    Thank you for you help in advanced.

    See also [[Protecting stored passwords using a master password]]
    Do you need those passwords to be entered automatically on websites or does only your boss need to have access to them and use the passwords?
    Your above posted system details show outdated plugin(s) with known security and stability risks.
    *Next Generation Java Plug-in 1.6.0_15 for Mozilla browsers
    Update the [[Java]] plugin to the latest version.
    *http://java.sun.com/javase/downloads/index.jsp (Java Platform: Download JRE)

  • How to hide the source of class from others?

    Good day!
    Recently (I'm novice) I found many programs that allow to get from
    .class file .java file, e.g. any people can access the source code
    of my work...
    So, how can I prevent this?
    Thank you in advance!

    Add an @author tag in your source code, may be some copyright notice/warning (if any) and forget...
    anybody who opens ur compilied class will see ur name..
    leave the rest to them, let them copy if they need to why bother..
    We are moving to open source, right!!! May be some one might report an error/bug, for good.
    Sorry if this doesn help,
    Sneha.

  • How to find the main java class file

    I need to write a Java program which MUST know one of these:
    1) the full path to the main java class (the class with "main" method)
    or
    2) access to the main class as byte array.
    If i know (1) then I have no problems reading the main class into byte array, but the main target is still (2).
    Another option is if the main file is in JAR, which again leads to problems, because I cannot access the file in normal way, but I still need access to the exact byte stream.
    Any help is highly appreciated! Thanks!
    <<< Ivan Davidov >>>

    You could try somthing like this in your main-method:
    InputStream is = getClass().getResourceAsStream(<"myModifiedPackageName/MyClass.class">);I don't know if this works though.
    Have a look at the API doc for this method.
    -Puce

  • Set the password for zip file in unix

    Hi All,
    I have used the below command to zip the file and it is working fine.
    cd /YYYY;zip -r ZZZZ.zip ZZZZ.TXT
    While using the below command to set the password on zip file , I am getting error like "zip error: Invalid command arguments (encryption not supported)
    zip -P password -r ZZZZ.zip ZZZZ.TXT
    Can you please help me how to set the password for zip file in UNIX.
    Thanks,

    Do you use any characters in the password that might confuse the zip command? (like '-' or ';'?)
    If I use the command in RHEL4:
    cd /tmp
    zip -P password -r tt.zip gconfd-oracle
    adding: gconfd-oracle/ (stored 0%)
    adding: gconfd-oracle/lock/ (stored 0%)
    adding: gconfd-oracle/lock/ior (deflated 67%)

  • How do I remove password when deleting files...lion

    Hi. I upgraded to Lion.
    I need to know how to remove the password everytime deleting files.
    Im going crazy...how do I remove that appliction ?
    MBK

    Thanks for your speedy reply, Mr. Alexander. I did try that yesterday, going to the doc and making sure it wasn't a read only, or locked, but it didn't seem to solve the problem. I created the files using Pages and saved them as Word docs. 45 -50 files were grouped in a master file. I attempted to send the master file via Mac's mail software and then gmail. Both requested a password from the recipient--which I did not have. I then zipped it and sent it via gmail. I think the recipient could open the main file but not extract individual files without a password. Files were sent to a PC user. I haven't had trouble sending individual files prior, though I have not tried to send these specific ones separately as I'm hopeful there's a better way.
    Thank you for time and assistance.

  • Hide the password "sqlplus log/pass"

    Hi,
    I am using the following command and running through the shell script.
    Unix Prompt> sqlplus abc/abc @sqlplus_settings.sql
    Now when I do ps -ef |grep abc. It shows me the username and password "abc".
    How can hide the password
    Thanks and regards
    KP
    null

    1. you could put the username/password as
    the first line of u're sqlscript.
    2. or use the following syntax in unix ksh
    sqlplus << END_OF_SQLPLUS_CMDS
    username/password
    @sqlplus_settings.sql
    END_OF_SQLPLUS_CMDS
    unfortunately the above ksh will exit once it executes sqlplus_setting.sql ..so is only useful for running batch scripts
    3. if u're purpose (as it seems from the name of u're script ) is to set some initial sql*plus settings like linesize ,pagesize etc...then try using login.sql SQL*Plus always looks for this script in the current dir or the ORACLE_PATH and runs it as it connects to a session.

  • How do i hide the password in my jdbc connection?

    I just want to ask how to hide my password in my jdbc connection because when someone decompile my class and read my code, he can change the content of my database. I want to know the steps behind it.
    my code goes like this
    DriverManager.getConnection("jdbc:mysql://localhost/fruits", "admin", "3xmrk");

    i opened a notepad and write my jdbc properties and save it as database.properties.
    and i tried to test it with the following code but i get a null pointer exception... is my way of creating .properties file is wrong??
    import java.util.*;
    import java.io.*;
    public class Testing2
         public Testing2()
              Properties props = new Properties();
              try
                   InputStream in = getClass().getResourceAsStream("database.properties);
                   if (in == null)
                        throw new NullPointerException("Could not find database.properties");
                   props.load(in);
              catch (IOException e)
                   throw new RuntimeException(
                        "Error loading dbservices.properties from classpath.", e);
              String dbUrl_ = props.getProperty("dbUrl");
              String dbLogin_ = props.getProperty("dbLogin");
              String dbPassword_ = props.getProperty("dbPassword");
         public static void main(String args[])
              new Testing2();
    }

  • Question on how to Hide the User Name, Password, and Domain fields in the MDT Wizard

    MDT 2012 U1
    Deploying Windows 7 via Offline Media (ISO) to MS Virtual PC's
    I am looking on how to Hide the User Name, Password, and Domain fields which are prepopulated in the MDT wizard via the CS.ini (Not so concerned about the Domain field as I am User Name and Password)
    We do need the Computer Name and OU fields to be seen, so skipping the wizard is not a option
    The client just does not want these fields to be seen by the end users, they dont want them to even know the account name used for adding the machine to the domain, of course the password is not displayed but it must not be displayed either.
    But since we use the fields they must still  be fuctional just not seen.
    Thanks.....
    If this post is helpful please click "Mark for answer", thanks! Kind regards

    You shouldn't have to edit DeployWiz_Definition_ENU.xml. You should only need to add "SkipAdminPassword=YES" to the CS.ini file and your authentication information.
    Example:
    [Settings]
    Priority=Default
    Properties=MyCustomProperty
    [Default]
    OSInstall=Y
    SkipCapture=NO
    SkipAdminPassword=YES
    UserID=<MyUserID>
    UserPassword=<MyPassword>
    UserDomain=<MyDomain.com>
    SkipProductKey=NO
    SkipComputerBackup=YES
    SkipBitLocker=NO
    -Nick O.
    Nick,
    SkipAdminPassword=YES is for:
    You can skip the Administrator Password wizard page by using this property in the
    customsettings.ini.
    I am hidding the Username/Password/and domain field in the computer name Wizard pane which is read from the cs.iniDomainAdmin=xxxxx
    DomainAdminPassword=xxxxx
    DomainAdminDomain=xxxxxx
    JoinDomain=xxxxxx
    If this post is helpful please click "Mark for answer", thanks! Kind regards

  • How can I hide the password and user name in url???

    Hi experts,
    I'm creating a login page and know I have a problem.
    The Username and password are verified in a Java class, after checking the user and password, the user should be linked to the portal.
    So far everything has worked well.
    But when I call the lin like this
    res.sendRedirect ("/ irj / portal j_user =" + UserN + "& j_password =" + passw);
    then the user name and Pwasswort appears in the url.
    Can someone tell me how can I hide the password and user name???
    It will be very helpful.
    Thank you
    Edited by: Cilvaring on Aug 5, 2011 12:00 PM

    If there is no specific reason that you have to use sendredirect...thne you can try request.forward.....
    RequestDispatcher rd = request.getRequestDispatcher("pathToResource");
      rd.forward(request, response);

  • How can I run a a class file on the Apache server?

    Hi Guys and Gurus,
    I am seeking some favor all of experienced gurus, i.e.
    How can I run a a class file on the Apache server?
    Actually, I want to extract some records from a MySQL Database running on Apache Server. I wrote a program just to select the columns and show them. It is now a Class file, Now how can I run this class file from the Server???
    Please advise...
    VJ

    cross posted
    http://forum.java.sun.com/thread.jsp?thread=299137&forum=31&message=1184025

  • URGENT PLEASE:How can I run a a class file on the Apache server?

    Hi Guys and Gurus,
    I am seeking some favor all of experienced gurus, i.e.
    How can I run a a class file on the Apache server? Can I run through an Applet?
    How can I set Environment variables in Windows2000 Professional Environment?
    Actually, I want to extract some records from a MySQL Database running on Apache Server. I wrote a program just to select the columns and show them. It is now a Class file, Now how can I run this class file from the Server???
    The code is here
    import java.sql.*;
    public class RecordShow {
    public static void main(String args[]) {
    String url = "jdbc:mysql://localhost/myhost";
    Connection con;
    String query = "select mytable.column," +
    "from mytable " +
    "where mytable.column = 1";
    Statement stmt;
    try {
    Class.forName("com.mysql.jdbc.Driver");
    } catch(java.lang.ClassNotFoundException e) {
    System.err.print("ClassNotFoundException: ");
    System.err.println(e.getMessage());
    try {
    con = DriverManager.getConnection(url,
    "myuser", "mypassword");
    stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery(query);
    ResultSetMetaData rsmd = rs.getMetaData();
    int numberOfColumns = rsmd.getColumnCount();
    int rowCount = 1;
    while (rs.next()) {
    System.out.println("Row " + rowCount + ": ");
    for (int i = 1; i <= numberOfColumns; i++) {
    System.out.print(" Column " + i + ": ");
    System.out.println(rs.getString(i));
    System.out.println("");
    rowCount++;
    stmt.close();
    con.close();
    } catch(SQLException ex) {
    System.err.print("SQLException: ");
    System.err.println(ex.getMessage());
    Please advise... THANKS
    VJ

    Ehm, I wasn't referring to you at all... read up,
    there's a comment by jschell saying that CGI might be
    easier/better for his purposes.
    Yep.
    I know PHP/Perl/whatever might be easier for some
    purposes, but only if you happen to know them and want
    to/are able to use them. Ok. But you aren't the one asking the question are you. And the person who asked the question seems to have absolutely no familiarity with Apache or applets.
    So whatever they do they are going to have to learn a lot.
    And that does indeed suggest that in all likelyhood they have not investigated the alternatives.
    And for the vast majority of internet applications, especially with smaller projects (obvious this person is not working with a large team), using perl, or something besides java, is going to be the best business solution. It is simpler, and more secure (probably due to the fact that it is simpler.)
    Since this is a Java forum, I
    answer under the assumption that people have made a
    choice one way or another to use a Java solution to
    their problem, so I try to solve it in Java first, and
    only when that fails (very seldom) do I turn to other
    solutions.You approach problems by arbritrarily deciding to try to solve it in java first and only if you fail do you then look to other solutions?
    My first step is to try to figure out which of the various avenues is going to cost less. (And a secondary, but non-trivial concern, is then to convince the customer that just because they have heard of a buzz word like 'enterprise bean' that it doesn't mean that is a cost effective solution.) We must come from different worlds.

  • How to hide the file name (the bizarre number assigned by the camera) when exporting an image version in aperture from an album. Pl understand I want to keep the file name in the project library version.

    how to hide the file name (the bizarre number assigned by the camera) when exporting an image version in aperture from an album. Pl understand I want to keep the file name in the project library version.

    Within Aperture you have Images, which are constructed on-the-fly from two files (the Master and the Version).  You get an image-format file _only_ when you export an Image.  You select the file name (usually a scheme) when you create an image-format file (that is, when you export).  Look under "Aperture→Presets→File Naming" for built-in Presets.  You can, of course, create your own or customize any provided.
    The Preset is applied to only the file newly created by your "export" command.  It is not applied to the Image in Aperture (unless you rename your Versions or your Masters).

  • How-to hide the portal file shares on Windows

    Hi,
    Does anybody know how to hide the default file shares created by SAP NW 04 in windows?
    In other words: what I'm trying to accomplish is renaming the sapmnt share and saploc share (both on the E:\usr\sap\ folder) to sapmnt$ and saploc$.
    I know how to do the Windows part, but where and how do I configure the SAP Web AS part?
    Regards,
    Steven Dijkman

    Hi guys,
    Thanks for all the feedback.  However, this still does not fully work.
    I tried hiding the folder but it in fact only hides the folder, not the share itself. I'm trying to do the opposite, hiding the share (making it an administrative one) whilst not hiding the folder. With the folder hidden, the startup framework (NW 04 EP6 SP12) does not work.
    By the way: checking / tightening access is not an option: security architects dictate what needs to happen here and unless I have VERY good reasons I should comply to what they say: change saploc to saploc$ and change sapmnt to sapmnt$.
    If anybody has anymore thoughts, I'd be very interested.
    Cheers,
    Steven Dijkman

  • How to hide username/password in JDBC program.

    hi All,
    The support tat I get here is simply gr8.
    Can someone suggest or send me a link as to how I hide the username /password ....i.e database connection in the jdbc program so as to avoid changing the program everywhere in case username and passwd changes ?????
    I simply want to change the following code
    String driverName = "oracle.jdbc.driver.OracleDriver";
    Class.forName(driverName).newInstance();
    // Create a connection to the database
    Sring serverName = "127.0.0.1";
    String portNumber = "1521";
    String sid = "oratest";
    String url = "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":" + sid;
    String username = "scott";
    String password = "tiger";
    connection = DriverManager.getConnection(url, username, password);
    Ta,
    sunny

    well i kind of support what my fellow poster neeelima.srtidhar said..
    Use of Connection Pooling via JNDI which is either provided by appln server or using custom built frameworks is the best method which i can think of instead of reinventing the wheel by creating a Properties file and then writing a Utility Class which ultimately endup in creating connection Object without any sort of optimal usage.
    checkout the below articles for reference of how to do it.
    http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html
    http://www.informit.com/articles/article.asp?p=352320&rl=1
    http://www.codeproject.com/useritems/pool_client_jboss.asp
    http://edocs.bea.com/wls/docs81/jdbc/programming.html
    http://www.castor.org/jdo-pooling.html
    http://homepages.nildram.co.uk/~slink/java/DBPool/
    and if you are thinking of reinventing those that could be possible using the below article
    http://www.javaworld.com/javaworld/jw-05-2002/jw-0517-jdbcdriver.html?page=1
    Hope that might help:)
    REGARDS,
    RaHuL

Maybe you are looking for

  • HT6065 Mavericks 10.9.1 update broke my finder.

    I just updated to Mavericks 10.9.1 and now my finder doesn't work and neither does iMessage. Why you no work?!?!?!

  • OES2SP1 + AFP + -1659 error

    I'm having trouble getting Macs (with OSX 10.6) to connect to our OES2SP1 Linux server (with all the current patches installed). The Macs can connect to our NWSP8 servers without any problems. We have Universal Passwords configured & I have installed

  • Does the lens correction profile for the Canon 24-70 eliminate all distortion?

    The new Camera Raw seems excellent in the Lens Correction...I will be photographing dancers and will have only 9 feet to work with. I would like to use the widest lens I can with lens correction. The question is whether this new program will flatten

  • Why do downloaded books in ibooks return to the cloud?

    Sometimes the books we have downloaded to our iPad (running 6.1.3) will return to the cloud and are no longer on the iPad.   We don't know why Sometimes the books that we are currently reading return to the cloud. We have many purchased many iBooks. 

  • I would like to know the IP's that have accessed my account?

    Hi Community I would like to know if any other IPs (Times & Locations too) my Account of me.com or icloud.com for the FindMyIPhone has been Accessed. Like Account Activity you can find in Gmail for Security Purposes. Any Users Know how or have a way