How to generate password?

Dear all,
Do anyone know how to generate the password??
I don't know use which method to that aim...
Can anyone give some advices?

Here's the code:
public class RandomPassword
     int l = 0;
     int h = 5;
     String charr[] = {"A", "B", "C", "1", "2", "3"};
     private String[] rarr = new String[6];
     RandomPassword()
          buildPassword();
          printPassword();
     private void buildPassword()
          int n;
          for (int i = 0; i <= 5; i++)
               n = getRandom(l, h);
               rarr[i] = charr[n];
private void printPassword()
          for (int i = 0; i <= 5; i++)
          System.out.print(rarr);
          System.out.println();
private int getRandom( int lower, int upper )
double nNum = Math.random();
int nDif,nResult;
while ( true )
nDif = (upper + 1) - lower;
nResult = lower + (int)( (double)nDif * nNum );
if ( ( nResult >= lower ) && ( nResult <= upper ) )
return nResult;
     public static void main(String args[])
          try
               new RandomPassword ();
               System.exit(0);
          catch ( Exception e )
               System.out.println ( "Can not start program");
Klint

Similar Messages

  • How to generate password alpha numeric value

    dear friends,
    i have written a simple pl/sql to generate a password.
    declare
    cursor c1 is select * from passwd;
    begin
    for I in c1
    loop
    if I.pfno < 3000 then
    update passwd set pwd=I.pfno where i.pfno=pfno;
    ELSe
    update passwd set pwd=lpad(round(I.pfno/20520),4,'0') where i.pfno=pfno;
    commit;
    end if;
    end loop;
    end;
    In this the pfno is 8 digit alpha numeric. I get password generated when it is only numeric but how could i get if pfno is like 04MAS155.
    Kindly help as i have to generate the same as early as possible. I have already been given with procedure to generate random password by our guys but still as i had already generated password to some employees in my concern based on querries like above i request your help to generate for alpha numeric 8 digit number.

    -- get a random string
        FUNCTION string (opt char, len NUMBER)
              /* "opt" specifies that the returned string may contain:
                 'u','U'  :  upper case alpha characters only
                 'l','L'  :  lower case alpha characters only
                 'a','A'  :  alpha characters only (mixed case)
                 'x','X'  :  any alpha-numeric characters (upper)
                 'p','P'  :  any printable characters
            RETURN VARCHAR2;  -- string of <len> characters (max 60)
        PRAGMA restrict_references (string, WNDS);

  • How to know the system generated password when reseting users password?

    Dear All,
    I have reset password using "genarated new password" in the portal from User admin,but dont want to send a e-mail notification  to end users, instead of that i want to know the system generated password.
    But system doses't shows it.How can I tell what the password is and give it to the user?
    I have a All super admin rols.
    Pleas guide.
    Thanks in advance.

    Basically you can't! If you tell it to generate one, then that's only sent to the user. Why not enter your own random password or let the user pick their own through some sort of self service function?

  • How to get keychain to automatically ask to generate passwords

    I Two MacBook  Pros,
    when I setup a password on my computer safiri automatically opens Keychain and it asks if I want to gererate a password, and offers to save it.
    Keychain is turned on.
    On My wifes computer when I go to setup a password, keychain dosen't start up and dosent offer to generate a password.
    Keychain is turned on, on this computer also.
    we both are current with Maverick 10.9.2
    anybody know how to make her computer automatically ask to generate passwords etc?

    Hi Dave n Laura!
    If you are having an issue with your iCloud Keychain, you may want to use the troubleshooting steps in the following article to help you address this issue:
    iCloud: Troubleshooting iCloud Keychain
    http://support.apple.com/kb/TS4644
    Safari isn't automatically filling in account names and passwords on some web sites.
    Devices using iOS 7.0.3 or later:
    Go to Settings> Safari > Passwords & AutoFill and make sure that these two settings are turned on:
    Names and Passwords
    Always Allow
    Return to your Home screen and open Safari. If Safari is black or dark instead of white or gray, Private Browsing is turned on. Safari doesn't save account names and passwords when Private Browsing is turned on. To turn off Private Browsing:
    On iPad, tap the the plus + symbol in the upper-right corner of the Safari page, then tap Private in the lower-left corner.
    On iPhone and iPod touch, tap in the lower-right corner of the Safari page, then tap Private in the lower-left corner.
    Macs using OS X Mavericks v10.9 or later:
    Choose to Safari > Preferences, then click Passwords.
    Make sure that that these two checkboxes are selected:
    AutoFill user names and passwords.
    Allow AutoFill even for websites that request passwords not be saved
    Open the Safari menu and make sure there's not a checkmark next to Private Browsing. Safari doesn't save account names and passwords when Private Browsing is turned on.
    I get a message saying that Safari will not save the password on one of the websites I'm using.Safari will not save or autofill account names and passwords on some websites that request that passwords not be saved. To allow Safari AutoFill on those websites:Devices using iOS 7.0.3 or later:
    Go to Settings > Safari > Passwords & Autofill.
    Turn on Always Allow. You must have a passcode lock on your device to enable this feature.
    Macs using OS X Mavericks v10.9 or later:
    Choose Safari > Preferences, then click Passwords.
    Select “Allow AutoFill even for websites that request passwords not be saved”. You must set a screen lock before your Mac can use this feature.
    Thanks for coming to the Apple Support Communities!
    Cheers,
    Braden

  • How to generate random password as per password policy by knowing the resou

    Hi,
    Any body tell me, how to generate random password as per password policy by knowing the resource object in OIM11g
    Regards,
    Nishith Nayan

    Hi Nayan,
    You can try below code snippet:
    UserRepository ur = new DBUserRepository();
    UserInfo user = ur.getUserInfo(userKey);     
                   ResourceRepository rrepo = new ResourceDBRepository();
                   Resource resource = rrepo.findResource(resourceName);
                   PasswordPolicyAssignmentsRepository par = new PasswordPolicyAssignmentsDBRepository();
                   PasswordPolicyRepository ppr = new DBPasswordPolicyRepository();               
                   List passwordPolicyAssignments = par.getPasswordPolicyAssigments(resource);     
                   PasswordPolicy passwordPolicy;     
                                            PasswordPolicyAssignment passwordPolicyAssignment = (PasswordPolicyAssignment) passwordPolicyAssignments.get(0);
                             if (isApplicable(passwordPolicyAssignment, getMappedAttributes(userInfo.getAttributes()))) {                            
                                  passwordPolicy = ppr.find(passwordPolicyAssignment.getPasswordPolicyID());                    
                                                 RandomPasswordGeneratorImpl rpg = new RandomPasswordGeneratorImpl();
                             password = rpg.generatePassword(userInfo, passwordPolicy);
    regards,
    gyan

  • Generating password protected pdf document -PLSQL

    Experts,
    Can please anyone to share the code how to do password protect the pdf which is located in unix directory.

    Google gave me below links :
    http://technology.amis.nl/2012/04/11/generating-a-pdf-document-with-some-plsql-as_pdf_mini-as_pdf3/
    PL/PDF generate and manipulate PDF with Oracle PL/SQL
    https://community.oracle.com/thread/2419241?tstart=0
    Regards
    Girish Sharma

  • Programmatically generate password for pdf with data from database

    Good day everyone,
      I would like to know is it possible to programmatically generate passwords for pdf??
    The main idea is to enable an automated process of pdf acquiring individualised password from a database (Excel, Access, you name it) and finally sending the pdf to individual recipient. Can I use javascript for this? And if yes, how?? If not, pls do advice me on the appropriate steps.
    Background (for clarity's sake): 
      Currently I am working on developing an automated process for the sending customised, password encrypted payslip to about 80 staff. The entire procedure is pretty much summarized as below:
    mail merg (UBS output in) excel to words -> convert words to pdf -> programmatically password encrypt the pdf -> email to individual recipients.
    Well my current status is - I am quite done with the batch mail merge and convertion part. And batch proccessing of password encryption is not a problem, but the idea is to allow acrobat to retrieve password automatically from a database and not key-in each and every password manually. The batch email for now is another problem but for now I have to work stepwise. (Any ideas on how to do it would equally be valued though! =D)
    System and software using:
    Windows  XP and 7 Professional
    Microsoft Office Proffesional 2010
    Adobe Acrobat X Pro
    I would be really grateful for any relevant replies to my question and any additional thoughts or ideas are welcome!!
    I would to thank any potential saviour in advance!
    Thank you for helping!

    Basically I need to automate the password generation from database extract
    e.g. Excel database with StaffID, StaffName, PayMonth, etc. Then when the pdf is created, its password would be <StaffID>_<PayMonth> which is extracted from excel.
    Is it possible for this to happen?? I dont mine using Javascript, I'll just have to learn it.
    Or how about recommending a program which does that??
    Whichever is fine as long there's a solution!
    Thanks!

  • Set custom generated password during create user and email to user

    Hi,
    In OIM 11g r2, I want to  generate password using some logic and send a notification to the user with the generated password during user creation.
    Please let me know how to achive that..
    can I use some post process event handler?? if yes then how to set the custom password to the user.

    Refer:
    How To Use The OIM 11g Password Generator Feature To Generate Random Password For A User (Doc ID 1273464.1)

  • How to generate a random session variable in php

    i want to generate a random session variable and insert the variable in a mysql record to use later to validate an account set up.
    person fills out form to create account and submits; inserts form information in mysql record.
    i want the random variable to be inserted from a hidden field and the page sends an email with a link to click on to compare the variable to validate the user.
    Not sure how to generate a random session variable and get that to the hidden field value to be inserted with the other form information.
    thanks for your help,
    Jim Balthrop

    To insert the key I would personally do something like...
    $key = md5($username . $password . $salt);
    Insert that into your MySQL database, then send them a email with it, my next code shows how to activate it.
    This is to activate the account.
    <?php
    $key;
    $errors = array();
    if(isset($_GET['key']){
         $key = $_GET['key'];
         $sql = 'SELECT * FROM users WHERE key = \'' . $key '\' LIMIT 1';
         $result = mysql_query($sql) or die(mysql_error());
         if(mysql_num_rows($result)){
              $sql2 = 'UPDATE users SET active = 1 WHERE key = \'' . $key '\' LIMIT 1';
              $result2 = mysql_query($sql2) or die(mysql_error());
              if($result2){
                   //successfully activated account
              else{
                   //Something Went Wrong!
         else{
              $errors[] = 'Invaild Key, Please try again!';
    else{
         $errors[] = 'Invaild Key, Please try again!';
    ?>

  • How can reset password of bulk users in one time through AD or script?

    how can reset password of bulk users in one time through AD or script?

    Hello Mr. Lovely,
    Do you have ActiveDirectory Module which shipped with Windows Server 2008 R2? If you have it, you can complete this task very easily.
    #First, you need to import ActiveDirectory Module
    Import-Module ActiveDirectory
    #Second, generate a SecureString which contains the password.
    $securePwd = ConvertTo-SecureString -String "P@ssw0rd!" -Force -AsPlainText
    #Third, find the Active Directory users ,and use Set-ADAccountPassword for resetng the password.
    Get-ADUser -Filter {Name -like "Test*"} | Set-ADAccountPassword -NewPassword $securePwd
    Also, you can review following link for more details about the Active Directory cmdlets.
    Active Directory Cmdlets in Windows PowerShell
    http://technet.microsoft.com/en-us/library/ee617195.aspx
    Best Regards,
    Greg Gu
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • How to encrpt password for Secure store service while configuring by Windows powershell Script

    To configure Secure store service, we have to mention user name and passowrd for generating key.
    For this is password we are giving in plain text which is readable and also which is security violation as per company rules.
    so i want to encript the password,so that no body can read and it is not against security violation.
    so any body can tell me how to encrpt password while configuring secure store service using powershell command

    Hi,
    For your issue, you can encrypt the files using Encrypting File System. By this method, only the user that stores it can access the encrypted passwords.
    For more information, you can refer to the thread:
    https://social.technet.microsoft.com/Forums/en-US/bae4f78b-e12e-4afe-981f-d93909d33d5a/what-is-the-most-secure-method-to-store-password-in-powershell?forum=winserverpowershell
    Thanks,
    Eric
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Eric Tao
    TechNet Community Support

  • RE: (forte-users) .fnd & .fso files ?? What are them,how to generate th

    'kay dudes.
    complcl does the trick
    thanks
    j-p
    -----Message d'origine-----
    De: Jean-Paul Gabrielli [mailto:Jean-Paul.Gabriellisema.fr]
    Date: mercredi 4 octobre 2000 11:39
    &Agrave;: zeForte-users
    Objet: (forte-users) .fnd & .fso files ?? What are them, how to generate
    them?
    Hi,
    Sounds like an information about currency symbol is stored in the
    fnd file,
    whereas fso is binary.
    What are they, what do they come from, and how to regenerate them ?
    thanks
    j-p
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com

    Maybe this is something you already did, maybe not.
    You need to manually add "DCE" to the list of "Installed Libraries" in the
    properties dialog of the NT-node (using E-Console).
    Of course, don't forget to export your target environment and re-import it
    in your development environment.
    Pascal Rottier
    Atos Origin Nederland (BAS/West End User Computing)
    Tel. +31 (0)10-2661223
    Fax. +31 (0)10-2661199
    E-mail: Pascal.Rottiernl.origin-it.com
    ++++++++++++++++++++++++++++
    Philip Morris (Afd. MIS)
    Tel. +31 (0)164-295149
    Fax. +31 (0)164-294444
    E-mail: Rottier.Pascalpmintl.ch
    -----Original Message-----
    From: Tucci, Lisa M. [mailto:LMTucciWest.com]
    Sent: Friday, December 15, 2000 10:23 PM
    To: forte-userslists.xpedior.com
    Subject: (forte-users) unable to move partitions.
    We have an odd problem. We have 2 partitions that when we do initial
    partitioning are placed on our Unix node but we need to move them to our NT
    node. For some reason forte will not allow us to move these particular
    partitions. They need to have the DCE thread package to be able to move
    them to the NT node but we can't seem to find any way to give them that
    thread package. Any suggestions, documentation anything would be greatly
    appreciated. We are due to deploy this application on Monday and are unable
    to do anything until we can get these partitions moved. We have been able
    to move them in the past but it seems to have been a fluke. We have not
    found any identifiable pattern of what has allowed us to move these
    partitions.
    Thanks!
    Lisa M. Tucci - Applications Programmer
    Inbound Fort&eacute; Application Support and Development - West Telemarketing
    Corporation
    tel.: (402) 964-6360 ex: 208-4360 stop: W8-IS e-mail: lmtucciwest.com
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com

  • How to pass password from jsp to Applet

    Hi ,
    I can pass the user to applet like below. But password will be seen from view source.
    How can pass password without showing in the view source.
    <PARAM NAME="loginname" VALUE="<%=request.getParameter("loginname")%>">
    <PARAM NAME="loginpassword" VALUE="<%=request.getParameter("loginpassword")%>">
    Thanks in advance.
    Rockesh

    Or alternatively, determine why you need to pass the password on to the Applet.
    For example, if the Applet needs to log into a resource, it is much more secure to ask the user for a password then, as opposed to getting the password from a form, passing it on to the Applet and then having the Applet blindly relay the password to the server, the database, whatever.
    If the Applet doesn't need to do anything with the password, then I must question the wisdom of passing on the password in the first place.
    If the Applet uses the password to do authentication, then the best solution is to generate hashes of the password and compare those hashes as needed. This would make it much more difficult for someone to either eavesdrop on it, or guess it through random trial and error. We can take it one step further. When the JSP code is executed - generate a one time unique password that's extremely long, at least 128 characters. Embed the password in the resulting HTML page as a hidden field and seed the Applet with the password. That would tie the Applet to a particular web page.
    I really like SpinyNorman's JavaScript, but if that's indeed your purpose, you might as well do it in the Applet itself. In other words, it's kind of pointless to ask for a password in order to launch the Applet - once the user gets the Applet's URL by some means, he can just bypass the JavaScript authentication.

  • How do you password protect web gallery

    Iphoto is easy to protect. How do you password protect your movies in webgallery? The help menu is not very clear

    The best I can figure out is that if you post your movie to the Gallery, but do not select the option to "Show project on Web Gallery home page," the video will not show on your home page for random visitors. When the movie is done posting, you can send the direct link of your video to whomever you want by copying it from the confirmation page after the video uploads. Not perfect, but the only option I see right now.

  • How to generate jasper report in pdf format using swing

    hi all,
    im new to swing and jasper.. can anybody provide me some example on how to generate the jasper report in pdf format? i will call the reportManager from sessionBean.. below is my code:
    1)delegate:
    public GenerateReportDto generateIntoPdfReport(String fileName, String outputFileName, Map parameters){
    GenerateReportDto generateReportDto = getAuditTrailServiceRemote().generateIntoPdfReport(fileName, outputFileName, parameters);
    return generateReportDto;
    2)sessionBean:
    public GenerateReportDto generateIntoPdfReport(String fileName, String outputFileName, Map parameters){
    //Map parameters = new HashMap();
    ReportManager reportManager = new ReportManager();
    3)ReportManager()
    public void generateIntoPdfReport(String fileName, String outputFileName, Map parameters) {
              Connection conn = null;
              try {
                   conn = dataSource.getConnection();
                   //Generate the report to bytes
                   File reportFile = new File(fileName);               
                   byte[] bytes =
                        JasperRunManager.runReportToPdf(
                             reportFile.getPath(),
                             parameters,
                             conn
              //conn.close();
              //Write the bytes to a file
              ByteBuffer buf = ByteBuffer.wrap(bytes);
              File file = new File(outputFileName);
              // (if the file exists)
              boolean append = false;
              // Create a writable file channel
              FileChannel wChannel = new FileOutputStream(file, append).getChannel();
              // Write the ByteBuffer contents; the bytes between the ByteBuffer's
              // position and the limit is written to the file
              wChannel.write(buf);
              // Close the file
              wChannel.close();
              } finally {
                   if (conn != null) {
    conn.close();
    Any help would be highly appreciated. Thanks in advance

    Hi ,
    One 'simple' way is by using the DBMS_SCHEDULER db package and the procedure CREATE_JOB(....) using as job_type the value 'EXECUTABLE'...
    Read for further info in 'PL/SQL Packages and Types Reference'.
    If you have access to OEM ... you can configure this there using wizard.....
    Other way is to use the External Procedure call capabiblity of Oracle DB Server...:
    http://www.oracle.com/pls/db102/ranked?word=external+procedure+call&remark=federated_search
    My greetings,
    Sim

Maybe you are looking for

  • How to sync BC4J entity changes across sessions?

    Hi, In my application, I have two ADF faces pages to manipulate a database table. For example, the table is: Schedule(TimeFrom,TimeTo,Description) For the scheduleDisplay.jspx, it displays all schedules in a table. For the scheduleEdit.jspx, it shows

  • Telnet Program Help

    I would like to write a program that does the following: 1. Telnet to a linux machine. 2. Execute an "ls" command. 3. Return the output of the "ls" command. 4. Parse the output for file names and display in a JTable. I found a sample program from the

  • After Effects CC Download Stalling

    My download/install of Adobe After Effects through the creative cloud download system appears to still be working, but has not moved from 90% for over an hour. Why is this and how can I make it resume?

  • Transition and effects gone...

    Apologies if I've missed this answer somewhere else... First day playing with FCE 4. I created a project in iMovie 08 that had a title on a black screen to start the project, transitioned into clip where I had changed the color to b&w. I did "Share"

  • Updated iPod now there's only 6 songs left

    Hi. I live in the uk and bought my iPod touch from uk, I came to australia on a holiday and connected it to a pc with iTunes and updated it, after the updated I only have 6 songs left on iPod touch. Everything else is there's just not my songs. What