How to make a password gen class

Hi all
I need to write a java bean that can dynamically general password which contain alphabet and number and long within 8 characters, any one has any ideal how to do that
Any advise will be greatest appreciate

Hi jleech
what is the different between SecureRandom class and Random class, should i use SecureRandom, my ideal is to genreate a completely reandom password, the code that show below which genreate 8 character between 0 to Z, and each character are in reandom, I thing that is quite secure, isn't it.
public boolean genPassword()
   int rand;
   char c;
   try
    while(password.length() < 8)
     rand=48+(int)(Math.random()*122);
     if((rand>=48&&rand<=57)||(rand>=65&&rand<=90)||(rand>=97&&rand<=122))
      c=(char)rand;
      password+=c;
    } //end of while loop
    return true;
   catch (Exception e)
    System.out.println(e.getMessage());
    setPassword("");
    return false;
}

Similar Messages

  • How to make  a Password Field in a Dynpro?

    Hi Folks,
    as the subject says i need to make a password field in my dynpro. i know how to do it with parameters but thats not what i need. i made a dynpro with a field in which Users can type a Password and i need it to be shown like this "********".
    how can i do this?
    thanks in advance.

    heh... its really annoying that i just can't find such easy things with google and have to post it in the forums -.-
    anyway. thanks a lot.

  • How to make copies of delivered class/function module.

    Hello All,
    Can anybody tell me how/where should I go, to make copies of delivered class "CL_HRMSS_RECRUITING_WF" and the function module "HRWPC_EREC_CREATE_EREC_OBJECT".
    Also if I am renaming with Z<my-class-name>, and using the method "CREATENBOBJECT" in my renamed class, will there be a problem with naming conflicts as "CL_HRMSS_RECRUITING_WF" already has the same method "CREATENBOBJECT".
    Kind Regards
    Srinivas.

    hi Srinivas,
    Can you tell me how I should create a package:
    <i>Ans:
    1-> GOTO transaction <b>SE80</b>
    2->Choose <b>Package</b> from the first drop down box
    3->enter a name starting with Z or Y, press ENTER
    4-> you will be prompted for confirmation to create a PACKAGE..Click YES..</i>
    Thats it.. package is created...
    <b>
    now go to attributes of each objects,  which you had created as local, and change the package name from $TMP to the name of the package that you have created...you will be prompted for Transport request..create a request by clicking on the create button...save...</b>
    Hope this helps,
    Sajan Joseph.

  • How to make the password stay in the process form

    Hi,
    I am working in OIM 10g. When ever we are changing any fields in process form the password field is getting blank.How do we make the password stay in the field after updating other fields in process form
    Thanks in advance

    When you open the default New Tab page - about:newtab - which has the Tiles and a Search Bar, the "focus" is in the Search Bar. You could change a hidden setting to have a blank page when you open a new tab if that's what you want - that will have the "focus" in the Location Bar . URL Bar.
    Type '''about:config''' in the URL bar and hit Enter.
    ''Accept the warning''
    Search field at the top to filter with this - '''browser.newtab.url'''
    Right-click the preference that appears below, and select '''Modify'''.
    Insert '''about:blank''' for the new string value.

  • 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).

  • How to make reset password "" Forget password " in dreamweaver cs4?

    hi
    i am using dreamweaver cs4 and i made a registration form and log in and log out  bit i want to send an e-mail to the user if he forget his/her password ... and i want also to make Remember Me function i know it is alot of things but i want help in them so please help me .....
    kareem

    Hi
    As far as I know the BIOS password can be removed by Service partner only. There is a way to do it but you should know that this can not be published because on this way it will be possible to start every stolen unit.
    Contact Authorized service partner and they will remove it. It can not costs a lot of money.
    Good luck!

  • HT4759 I am having a time trying to make a password it will accept,what is underscore mean exactly?help!

    I cannot seem to open icloud because I am not getting how to make my password correctly,what is underscore mean?It says I need letters,numbers,underscores and periods,how hard can this be? I have been trying forever.Now very frustrated,Help,please.

    The underscore is what you get if you hold the shift key down and type a minus/negative sign.
    Your password should contain both letters and numbers and you should have both small and capital letters, you don't need to worry about the rest.

  • Something keeps trying to download on my mac and I don't know what it is. It is not in the apple store and just comes out nowhere and request for my password to download something and I don't know what it is. How to make this stop?

    Something keeps trying to download on my mac and I don't know what it is. It is not in the apple store and just comes out nowhere and request for my password to download something and I don't know what it is. How to make this stop? It pops up every single day.

    Erica,
         I can, with 99.99% certainty, tell you that you are absolutely right in not wanting to download or install this "Helper," whatever it is (but we can be equally certain it would not "help" anything).
         I cannot comment as to Oglethorpe's recommendation of 'adwaremedic'; I am unfamiliar with it.  His links to the Apple discussion and support pages warrant your time and attention.
         It might be really simple -- Trying looking in your Downloads folder, trash anything that you don't know with certainty is something you want to keep, and then Secure Empty your Trash. Then remove the AdBlock extension, LastPass, and Web of Trust extensions to Safari and re-boot. If the issue goes away, still be extraordinarily careful in the future.
         Unfortunately, it's probably not going to be that simple to get rid of, in which case I'd then try the line by line editing in HT203987. 
         I have no further suggestions (other than a complete wipe and re-install...but that's a pain because trying to restore from Time Machine would simply ... restore the Mal).
       For the rest of us, please post when you find a solution.
         Best.
         BPW
      (Also, try to edit your second post -- black out your last name on the screenshot and re-post it for others)

  • I cannot figure out how to set my apple id to use: itunes (two of accounts), apps store and Itunes store. How do I make one password that will be recognixed by all these devices?

    I cannot figure out how to set my apple id to use: itunes (two of accounts), apps store and itunes store. How do I make one password that will be recognized by all these devices? My apple id is constantly not working.

    Hi Lrwill,
    If the apps that are on your son's iPad were purchased under his Dad's Apple ID, then signing your Apple ID onto the iPad will not help you with updating those apps.
    Also, if the iPad was sync'd with his Dad's iTunes library, then hooking it up to your computer/iTunes library, will require you to reset the iPad, and everything that was loaded under the other Library and Apple ID will be wiped out.
    Can you provide a little more info about what was set up under which Apple ID and what iTunes library the iPad was sync'd with?
    Cheers,
    GB

  • How can I make server use single class loader for several applications

    I have several web/ejb applications. These applications use some common libraries and should share instances of classes from those libraries.
    But applications are being deployed independently thus packaging all them to EAR is not acceptable.
    I suppose the problem is that each application uses separate class loader.
    How can I make AS use single class loader for a set of applications?
    Different applications depend on different libraries so I need a way that will not share library for all applications on the domain but only for some exact applications.
    When I placed common jar to *%domain%/lib* - all works. But that jar is shared between all applications on the domain.
    When I tried to place common jar to *%domain%/lib/applibs* and specified --libraries* attribute on deploying I got exception
    java.lang.ClassCastException: a.FirstDao cannot be cast to a.FirstDaoHere http://download.oracle.com/docs/cd/E19879-01/820-4336/6nfqd2b1t/index.html I read:
    If multiple applications or modules refer to the same libraries, classes in those libraries are automatically shared.
    This can reduce the memory footprint and allow sharing of static information.Does it mean that classes should be able to be casted ?

    You didn't specify which version of the application server you are using, but the config is similar as long as you know what to look for. Basically, you need to change the classloader delegation. Here's how it is done in 8.2
    http://download.oracle.com/docs/cd/E19830-01/819-4721/beagb/index.html

  • How to use custom password encryptor/decryptor class for jdbc connection

    I am in process of migrating application from Jrun server to weblogic . In jrun we use to provide our custom class which used to decrypt the password provided in resource file as below
    <username>webclt</username>
    <password>AAAAAAASSSSSSSCCCCCCCCCCCCCC</password>
    <encrypted>true</encrypted>
    <encryption-class>com.CustomEncryptor</encryption-class>
    How could i use the same class while configuring datasource in weblogic 10 server.

    1- By default, the jre will read the user's cacerts which runs the program.
    2- You can specify another cacerts this way :
    System.setProperty("javax.net.ssl.trustStore", my_trust);
    For the case 1 and 2, you need to put the certificate in the cacerts.. Or,
    3- You implement a custom TrustManager which, for example, accepts all certificates :
    class X509TrustManagerTrustAll implements X509TrustManager {
    public boolean checkClientTrusted(java.security.cert.X509Certificate[] chain){
    return true;
    public boolean isServerTrusted(java.security.cert.X509Certificate[] chain){
    return true;
    public boolean isClientTrusted(java.security.cert.X509Certificate[] chain){
    return true;
    public java.security.cert.X509Certificate[] getAcceptedIssuers() {
    return null;
    public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) {}
    public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) {}
    and you call it in the right place in the code you wrote (SSLContext,..)
    Hope it helps and deserves a duke star ;)

  • How to make a particular site password protected.

    Hi,
    Could you please tell me how to make a particular site to be password protected . Could you give me necessary code. I want a seperate login page to be opened when a particular site is opened.
    Edited by: vemana on Jan 1, 2008 10:37 PM

    I infer that you want to login validation on your webpages right.
    Ask user name and password from the user(using html or jsp), and submit those information to server. you can validation user information in server(using servlet). then redirect to client(JSP, html) according to login info.
    This is swing forum. Web Tier APIs topic is there for web page related questions. so next time onwards post there itself.

  • How do I add a website to remember the password after I have been to it before? I didn't know how to make the website remember the password initially.

    I want to have firefox remember a password on some sites that I have already been to previously. When it asked me initially, I didn't know how to make it remember. Now I would like for it to remember that site. Please explain how to do this.

    If you clicked "Never" then you have created an exception that you need to remove.<br />
    Otherwise Firefox should offer to store the name and password on the next visit when you sign on.
    Remove site(s) from the Exceptions:
    * Firefox/Tools > Options > Security: Passwords: Exceptions
    *https://support.mozilla.org/kb/make-firefox-remember-usernames-and-passwords
    *http://kb.mozillazine.org/User_name_and_password_not_remembered

  • Trying to enter hotel password and 1st letter is always upper case and password is lower case.  Can't figure out how to make 1st letter lower case

    I am trying to enter a hotel password for internet access.  The password is all lower case, but the 1st letter I type is always upper case and I can't figure out how to make it lower case.  Help?

    The digital keyboard on the iPad uses an "Up Arrow" as a symbol to represent its shift key(s). If it's highlighted, then the next letter typed will be upper-case. Just tap on the Arrow symbol and it should be unhighlighted. Now if you type any letter, it will be lower-case.

  • How to make class hiearchy,chractorstic hiearchy

    hi
    all
    how to make class hiearchy,chractorstic hiearchy
    please tail me the purpose with trs code
    suitable answers will be rewarded

    manoj,
    See [here|http://help.sap.com/erp2005_ehp_03/helpdata/EN/24/4765e5416711d189ec0000e81ddfac/frameset.htm] for more info
    PeteA

Maybe you are looking for