Please help: Encrypt Password

Very small query which has confused me a lot.....
I have to encrypt passwords and save them in to database, I am not getting where to start as I do not know anything about java encryption packages or other things.
Please let me know where can I find the names of all the algorithms and it will be very nice if u can tell me that which one should I use.
thanx

Hi,
MD5 and SHA-x Algorithms do not encrypt, these are so called hash algorithms which means they create a (hopefully) unique, fixed length byte array from what you give as input. Usually that is a way to store Passwords because you never need to decrypt a password (in the case of hash algorithms you are not able to do so anyway). If a user signs in, you hash his password and compare that created hash with the stored hash value. If they are equal, you can be sure enough (1:2^100 or something as chance that two different passwords create the same hash code) that the user knew his password. I know a lot of eBusiness plattforms that store passwords as MD5 or SHA-1 hash values. I think they can be seen as secure enough for such purposes.
Another story if you need the password in cleartext (maybe to start a batch process) but you don't want to store it as clear text. Then you have to encrypt the password and decrypt it when needed. But then you run into the problem where to store the encryption key so that nobody can decrypt your password with that.
The public key encryption is only usefull if you need to create a so called secret between two parties via an unsecure communication media. Like the HTTPS protocol does. The browser and the web server are exchanging public information (public keys) and then they are able to communicate secure without the need to share sensitive information in advance. But that is definitely not needed for your scenario.
The HMAC is another completely different story. It just says that you "can" use the MAC address of your Network adapter for the hash algorithm, but you don't need to do so. Since it is hard to read the MAC address from java I would not suggest to go in that direction.
I that now light enough? ;-)
Stephan

Similar Messages

  • TS1741 my i pad is lock up and i cant get it unlocked can you please help the password was used to many times

    my i pad is lock can someone please help  the password was used to many times

    If you have forgotten the iPad passcode and you cannot unlock the device, you have to restore the device within iTunes. You want to use the same computer that you always sync with so that you can restore your iTunes content. You can restore with any other computer, but you will lose everything on the iPad.
    Instructions can be found here.
    http://support.apple.com/kb/ht1212
    You will probably need to restore using Recovery Mode. You can read about it here.
    http://support.apple.com/kb/ht4097

  • Please help bios password

    Please help with bios password
    CNU9363GX8

    Hi,
    Please be aware that this is not supported by HP and you try it at your own risk.
    Try entering:       e9lofgfh4u                ( Note that the 3rd character is a lower case L )
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • Please Help! Passwords not accepted!

    Hi all,
    my nightmare finally took place
    This morning after restarting my laptop (due to software update installation)
    it won't recognized my password. The weird thing is that for the installation to took place I had to use it and it worked perfectly.
    One last thing, on my laptop I have also a Guest account which password is my first name and it won't work either.
    What's happening???
    Thanks for the help and support

    I have some more detail now.
    Behavior matches this: http://support.apple.com/kb/TS1413 but this isn't an iMac, nor am I on 10.5. (The disks have arrived but I need to finish a big job before upgrading.)
    I have used Console to determine that it's the LoginWindow process itself that's crashing. Viz:
    Oct 3 17:30:08 pjm-macbook /System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow: Login Window Application Started
    aped[256]: loginwindow[530] is running as the super-user. It is not possible for Application Enhancer to affect this process in any manner whatsoever.
    Oct 3 17:30:08 pjm-macbook loginwindow[530]: Login Window Started Security Agent
    Oct 3 17:30:09 pjm-macbook crashdump[546]: lsregister crashed
    Oct 3 17:30:09 pjm-macbook /System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow: Login Window Application Started
    Oct 3 17:30:09 pjm-macbook crashdump[544]: loginwindow crashed
    aped[256]: loginwindow[549] is running as the super-user. It is not possible for Application Enhancer to affect this process in any manner whatsoever.
    Oct 3 17:30:10 pjm-macbook loginwindow[549]: Login Window Started Security Agent
    Oct 3 17:30:10 pjm-macbook crashdump[544]: crash report written to: /Library/Logs/CrashReporter/loginwindow.crash.log
    Oct 3 17:30:11 pjm-macbook crashdump[547]: crashdump crashed
    Oct 3 17:30:11 pjm-macbook crashdump[547]: crash report written to: /Library/Logs/CrashReporter/crashdump.crash.log
    Here's the relevant section of the loginwindow.crash.log showing the exception and the top of the stack trace:
    Command: loginwindow
    Path: /System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow
    Parent: WindowServer [256]
    Version: 4.7 (4.7)
    Build Version: 3
    Project Name: loginwindow
    Source Version: 11700500
    PID: 530
    Thread: 0
    Exception: EXCBADACCESS (0x0001)
    Codes: KERNINVALIDADDRESS (0x0001) at 0x812645f0
    Thread 0 Crashed:
    0 com.apple.LaunchServices 0x9189fd02 LSHandlerPref::SetRoleHandler(LSDatabase*, unsigned long, unsigned long, unsigned long) + 40
    1 com.apple.LaunchServices 0x9189332b LSHandlerPref::Load(LSDatabase*) + 973
    2 com.apple.LaunchServices 0x91892eeb LSDatabaseClean(LSDatabase*) + 117
    Any hints are welcome, of course...

  • HT201269 I forgot my password for Encrypt my Backup how can I reset that please help I really need it Urgently???

    I forgot my password for Encrypt my Backup how can I reset that please help I really need it Urgently?

    If you do not know the passcode then you cannot use the backup
    Sorry

  • Please Help!!!  Encrypt/Decrypt Password

    i'm a newbie to Cryptography...and i know that this question have been asked MILLIONS of time...but i'm going to ask it again. i searched through the forum, and i didn't find anything useful...but:
    i want to write a program to encrypt the password i type in the JPasswordField...save it out to a Properties file...when i'm trying to authentication, get the password...decrypt the password...and authentication.
    i pretty much have the JPasswordField and Properties file done...i just need the encryption and decryption left.
    can someone please help??? please post example code...please don't suggest hashcode!!!
    sin sai

    Try this, found at:
    [ http://java.ittoolbox.com/documents/document.asp?i=1676 ]
    You can convert your password to MD5 format as follows:
    import java.security.*;
    import java.lang.*;
    public class PasswordEncrypt {
    * Constructor for the PasswordEncrypt object
    public PasswordEncrypt() { }
    * This is the method which converts the any string value to MD5
    format.
    *@param str password
    *@return encrypted password in MD5
    public String encrypt(String str) {
    StringBuffer retString = new StringBuffer();
    try {
    MessageDigest alg = MessageDigest.getInstance("MD5", "SUN");
    String myVar = str;
    byte bs[] = myVar.getBytes();
    byte digest[] = alg.digest(bs);
    for (int i = 0; i < digest.length; ++i) {
    retString.append(Integer.toHexString(0x0100 + (digest[i] &
    0x00FF)).substring(1));
    } catch (Exception e) {
    System.out.println("there appears to have been an error " + e);
    return retString.toString();
    ---

  • HT1222 i forgot my password at encrypt iphone back up.what should i do? please help me. thank you

    i forgot my password at encrypt iphone back up.what should i do? please help me. thank you

    Restore the device as new and setup as you desire.

  • HT4946 please help me.......i forgot my encrypt iphone backup pasword ......now i cant backup my contacts...is there anyway to get password back.....unfortunately i dnt have back on icloud n i need my contacts back ...plz plz plz help me

    please help me.......i forgot my encrypt iphone backup pasword ......now i cant backup my contacts...is there anyway to get password back.....unfortunately i dnt have back on icloud n i need my contacts back ...plz plz plz help me

    What happened to your phone that you are trying to restore to a backup that is encrypted? If you have your contacts in iCloud, you can just turn iCloud back on when you get the phone working, if it isn't, and that will bring your contacts back. You won't need to do a restore from an iCloud backup if you were not doing an iCloud backup anyway. If you log into www.icloud.com and look at contacts, what do you see there?

  • Dear Madam/ Sir. I have problem, I forgot the Encrypt iphone backup password. And I need to backup to now Iphone 5s but I can't.  Please help me.

    Dear Madam/ Sir.
    I have problem, I forgot the Encrypt iphone backup password. And I need to backup to now Iphone 5s but I can't.
    Please help me.

    You must first buy Snow Leopard from Apple: 800-MY-APPLE (in the US)
    Make sure your system meets Snow Leopard's requirements:
    Mac OS X 10.6 "Snow Leopard" System Requirements
    To install Snow Leopard for the first time, you must have a Mac with:
    An Intel processor
    An internal or external DVD drive, or DVD or CD Sharing
    At least 1 GB of RAM (additional RAM is recommended)
    A built-in display or a display connected to an Apple-supplied video card supported by your computer
    At least 5 GB of disk space available, or 7 GB of disk space if you install the developer tools

  • My WiFi name and password has changed. Did someone hack my WiFi? My computer can connect but not my iPhone 5s, and the connection for my computer is full, please help.

    Hello, this is my first post.
    Well lately I've been experiencing some connection issues with my iPhone 5s. I was on my iPhone just watching Youtube when my iPhone 5s disconnected, I tried to connect again by going to settings> Wi-FI> and then select my network as usual, but the weird thing is that my Wi-Fi network has changed it's name to Wireless, it used to be Wireless710. Also the password has been changed.
    My computer can easily connect due to the fact that it is hardwired to the Wireless Cable Modem Gateway.
    Extra Info:
    Carrier is Sprint.
    I am using Windows 7 Ultimate.
    My Wireless Cable Modem Gateway is Netgear.
    And now I am confused because when I open the small tab with the computer and a plug on the bottom right corner next to the speaker icon it says I'm not connected :/?! Here is a picture of it:
    Note that I can not connect to it but am connected on my computer. It just disappeared on my phone and computer, I even unplugged my router waited for 20 seconds and connected it back in. Did it wok? for my computer yes again because it is hardwired, but my phone? No. Wireless 710 still won't show up. Is this a possible hack? Please help me as much as you all can, thank you very much.

    Log in to the router's console with a web browser from your computer. What kind of encryption did you have on the router? If it was WEP that's about as secure as no encryption. It should be WPA or WPA2. There has been an exploit reported in Netgear and Linksys routers that allows someone connected to the router if Remote Access to the console is enabled to take it over and install spyware on it.
    Is it your router, or the cable providers? If it is yours it has been hacked. If it belongs to the cable provider they may have changed it to make it more secure. Call them.
    And if it has been hacked and is yours the best thing to do is to throw it away and get a new, more secure router. Or you can try reflashing the firmware by going to Netgear's site and downloading a clean copy.

  • Please help me ,i forgot the synchronising password for my mac pro lion backup disk

    please help me ,i forgot the synchronising password for my mac pro lion backup disk

    If the backup volume is encrypted, and you forgot the password, then you'll have to erase the volume and start a new backup. There's no way to recover the password.

  • Help with password encryption

    Hello I am trying to create a one way hash password encryption...here is what I have developed so far.....
    Login class (contains GUI)
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    import java.awt.image.*;
    import javax.imageio.*;
    public class Login implements ActionListener
      // declare class variables and objects
      // overall frame
      private FrameBase jf;
      // buttons
      private JButton btnNewUser,btnLogin;
      // data display labels
      private JLabel lblMessage, lblUser, lblPassword, lblTitle, lblCheck,lblNotes;
      // text fields for data entry
      private JTextField txtUser, txtPassword,txtCheck;
      // graphic object
      private BufferedImage eSay;
      // panels for organization
      private JPanel pnlTitle, pnlMain, pnlGraphic;
      // font objects
      private Font fntTitle, fntMain, fntControl,fntNotes;
      // user name for repeated set screen calls
      private String name;
      // store screen layout option code
      private int option;
      // option 1 - regular start-up
      // option 2 - new user screen
      // option 3 - user / password check
      public Login(String name)
        // set up the fonts
        fntTitle=new Font("Helvetica", Font.BOLD, 25);
        fntMain=new Font("Helvetica", Font.BOLD, 20);
        fntControl=new Font("Helvetica", Font.BOLD, 15);
        fntNotes=new Font("Helvetica", Font.BOLD, 16);
        // set the BufferedImage object to null;
        eSay=null;
        try
          // load the image from disk into a BufferedImage object
          eSay=ImageIO.read(new File("h:\\My documents\\ICS4M1\\Login\\eSay.jpg"));
          // set up the screen
          this.name=name;
          this.option=1;
          setScreen(name);
        catch (IOException e)
          // message if file not found
          System.out.println("Image not found");
      public void setScreen(String name)
        jf= new FrameBase(name);
        // set up the screen
        Container contentPane=jf.getContentPane();
        contentPane.setLayout(new BorderLayout());
        // set up the graphic
        pnlGraphic=new JPanel();
        pnlGraphic.setLayout(new BorderLayout());
        // load the BufferedImage into the ImageLabel
        ImageLabel il=new ImageLabel(eSay,"");
        // load the ImageLabel onto the panel
        pnlGraphic.add("Center",il);
        // set up the title section
        lblTitle=new JLabel("Welcome to eSay",0);
        lblTitle.setFont(fntTitle);
        lblMessage=new JLabel("Enter user name and password and click on Login or click on New User to set up a new account",0);
        lblMessage.setFont(fntControl);
        // set up the panel for the title area
        pnlTitle=new JPanel();
        pnlTitle.setLayout(new GridLayout(2,1));
        pnlTitle.add(lblTitle);
        pnlTitle.add(lblMessage);
        // set up the input section of the screen
        lblUser=new JLabel("User: ");
        lblUser.setFont(fntMain);
        lblPassword=new JLabel("Password: ");
        lblPassword.setFont(fntMain);
        lblCheck=new JLabel("Re-Type Password: ");
        lblCheck.setFont(fntMain);
        lblCheck.setEnabled(false);
        lblNotes=new JLabel("<html><font color=\"red\">User name 6 to 10 alphanumeric characters,  password 5 to 8 alphanumeric characters, </font></html>",0);
        lblNotes.setFont(fntNotes);
        txtUser=new JTextField(20);
        txtUser.setFont(fntMain);
        txtPassword=new JTextField(20);
        txtPassword.setFont(fntMain);
        txtCheck=new JTextField(20);
        txtCheck.setFont(fntMain);
        txtCheck.setEnabled(false);
        btnLogin=new JButton("Login");
        btnLogin.setFont(fntMain);
        btnNewUser=new JButton("New User");
        btnNewUser.setFont(fntMain);
        // make the button active
        btnLogin.addActionListener(this);
        btnNewUser.addActionListener(this);
        // assemble the input section panel
        pnlMain=new JPanel();
        pnlMain.setLayout(new GridLayout(5,2));
        pnlMain.add(lblUser);
        pnlMain.add(txtUser);
        pnlMain.add(lblPassword);
        pnlMain.add(txtPassword);
        pnlMain.add(btnNewUser);
        pnlMain.add(btnLogin);
        pnlMain.add(lblCheck);
        pnlMain.add(txtCheck);
        // add the panels to the screen
        contentPane.add(pnlTitle,"North");
        contentPane.add(pnlGraphic,"Center");
        contentPane.add(pnlMain,"East");
        contentPane.add(lblNotes,"South");
        // set up and show the frame
        jf.setSize(900,400);
        jf.show();
      } // end of setScreen()
      public void actionPerformed(ActionEvent e)
        if (e.getSource()==btnNewUser)
          if (option==1)
            lblCheck.setEnabled(true);
            txtCheck.setEnabled(true);
            lblMessage.setText("Create a login name and password, enter the password twice as indicated");
            btnLogin.setEnabled(false);
            option=2;
          else if (option==2)
            String tempUser=txtUser.getText();
            String tempPassword=txtPassword.getText();
            String tempCheck=txtCheck.getText();
            if (tempPassword.equals(tempCheck))
              ValidateUser vu=new ValidateUser(tempUser,tempPassword);
              if (vu.getEncryptedPassword()==null)
                lblMessage.setText("Please check guidelines for user name and password and re-enter");
              else
                lblMessage.setText("Login created - Welcome to eSay!");
            else
              lblMessage.setText("Passwords do not match, please re-enter login and password twice");
        else if (e.getSource()==btnLogin)
      }  // actionPerformed
      public static void main(String args[])
        Login l=new Login("eSay Message Board");
    }  // end class Login            User class
    public class User
      private String userName;
      private String password;
      private int numberLogins;
      public User(String userName, String password)
        this.userName=userName;
        this.password=password;
        this.numberLogins=0;
      // gets for surname, first name and number of logins
      public String getUserName()
        return userName;
      public int getNumberLogins()
        return numberLogins;
      public void resetLogins()
        this.numberLogins=0;
      public void login()
        this.numberLogins++;
      public static void main(String args [])
           // enter test statements here
    } // end of User classValidate User(validation)
              System.out.println ("A character is invalid");
              return false;   
        return true;        
         // create an encrypted password if user name and password are valid
        public void encryptPassword()
        // standard get for encrypted password
        public String getEncryptedPassword()
          return encryptedPassword;
    }PasswordService(One way hash conversion)
    package org.myorg.services;
    import java.io.UnsupportedEncodingException;
    import java.security.MessageDigest;
    import java.security.NoSuchAlgorithmException;
    import org.myorg.SystemUnavailableException;
    import sun.misc.BASE64Encoder;
    import sun.misc.CharacterEncoder;
    public final class PasswordService
      private static PasswordService instance;
      private PasswordService()
      public synchronized String encrypt(String plaintext) throws SystemUnavailableException
        MessageDigest md = null;
        try
          md = MessageDigest.getInstance("SHA");
        catch(NoSuchAlgorithmException e)
          throw new SystemUnavailableException(e.getMessage());
        try
          md.update(plaintext.getBytes("UTF-8"));
        catch(UnsupportedEncodingException e)
          throw new SystemUnavailableException(e.getMessage());
        byte raw[] = md.digest();
        String hash = (new BASE64Encoder()).encode(raw);
        return hash;
      public static synchronized PasswordService getInstance()
        if(instance == null)
          return new PasswordService();
        else   
          return instance;
    }

    I was wondering if someone could help me to incorporate some kind of one way hash into the encryptPassword method in Validate user...i am having problems trying to call on the PasswordService and incorporating everything. The reason i supplied all the code was so that the reader could understand how different programs correlate with one another

  • Have used firefox for 3 years, have a new computer now and every time I go into my normal places I get a warning about encrypted page and third party viewing, please help!

    I have used Mozilla Firefox for 3 years with no issues. I have now purchased a new laptop (Samsung) and cannot access my regular sites (like Windows Live or my banking, most everything) without getting a Yellow waring arrow stating that I am going into an encrypted page and third parties are able to see what I am doing. I am very concerned if others are having access. My bank says it has nothing to do with them...it is an https secure site. I still have major concerns, please help!

    For what it's worth, you posted this in 2011, and here in 2014 I am still having this same issue. Over the last two days, I have had to unlock my apple account 8 times. I didn't get any new devices. I haven't initiated a password reset. I didn't forget my password. I set up two factor authentication and have been able to do the unlocking with the key and using a code sent to one of my devices. 
    That all works.
    It's this having to unlock my account every time I go to use any of my devices. And I have many: iMac, iPad, iPad2, iPad mini, iPhone 5s, iPod touch (daughter), and my old iPhone 4 being used as an ipod touch now.  They are all synced, and all was working just fine.
    I have initiated an incident with Apple (again) but I know they are just going to suggest I change my Apple ID. It's a simple one, and one that I am sure others think is theirs. I don't want to change it. I shouldn't have to. Apple should be able to tell me who is trying to use it, or at least from where.
    Thanks for listening,
    Melissa

  • Please help about encode password idm !!!!

    Hello All,
    I'm a newbie in IDM and in my work I have to encode password with CBC Algorithm before insert password in database (SQL server 2005).
    So I have already coding CBC Algorithm but I don't know where I put my CBC encoding Algorithm for when users change password on IDM.
    Please help me.
    Thank you for advance.
    waltt

    I'm assuming you're not talking about storing the password that way in the IDM repository but rather a separate database resource.
    I had a similar requirement with a different encryption algorithm and an Oracle database. I made my life a lot easier by having the database resource do the encryption. IDM will insert the password into the resource as plain text and, in my case, a trigger will catch it, call a stored procedure to change it from plain text to encrypted and then insert it. Since IDM never reads passwords from resources anyway the password was fully encrypted as stored in the resource and IDM never knows any better.
    Technically speaking you could have created a rule or custom form to do the password encryption before IDM sends it over the wire but if you've got an encrypted channel to the database then you might take my approach and skip having IDM do it altogether.

  • Excel Download of a Web SAP BW Report asks userid and password.please help

    Dear BW folks,
    Issue: When I run a specific SAP BW Report from Web and download the same into excel & csv.
    When I open the excel file downloaded, it asks me user name and password to enter. csv file downloaded doesn't ask.
    The report has 0cust_sales hierarchy and SBU hierarchy.
    Is there any thing to do with these hierarchies that the excel download is asking user name and password?
    Please help me out!!!!! This report needs to be downloaded into excel sent to my manager.....
    Regards
    Pavan

    Hi Pavan
    It is possible,please refer the below link
    Report execution without prompting user id
    Providing un-secured access to a web report.
    Also, for the time being, you can run the query and save a workbook and sent across
    These will resolve the issue
    Thanks
    Pavan Agarwal

Maybe you are looking for

  • Table for finding the SHC numbers and PO numbers

    Hi Guys, Can anyone tell me where I can find the SHC number and PO number getting updated in one table. Also If I wanted to have both the data what should I have to do? Regards Srujank

  • My iPod touch 4gen will not update to iOS5... I NEED HELP

    Everytime I go to update my 4g iPod tough, it tells me the network connection was messed with or lost. I check my internet and everything is okay, nothing is wrong with my connection to the internet or the connection between my iTunes and the iPod it

  • Output Message Type MAHN not getting picked up in PO

    Hello Experts    I have configured customized output type ZMAH (similar to MAHN) for reminder process. When I am creating PO this output type is not getting picked up automatically. If I am maintaining it manually I am able to send message for ME9F (

  • Pulling a program out of the IDE

    I have been playing with pulling small progrograms out of my Integrated development environment (IDE); writing them to CD; and installing them on other desktops, just as an exercise in the case I want to deliver some applications to a friend. The ove

  • Catching and rethrowing a SOAP Fault from an OSB 11g Proxy service

    Hello, We have a chain of proxy services (that last one of which calls a business service) in our 11.1.1.6 OSB project.  At one of the lower levels, we successfully throw a fault like this: <soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap