How to get Password Hash in java ?

How can i get the hash password from one user to copy to other
application or ldap ( like sync ) in java ldap or jdbcldap ? Is it
possible ?
Exist some kind of class or method on java to get clear text Password
or hash password in eDirectory users ?
thanks !
samirissa
samirissa's Profile: http://forums.novell.com/member.php?userid=58315
View this thread: http://forums.novell.com/showthread.php?t=416414

In the Universal Password policy, there is an option to allow specific
user sto retrieve the password. I haven't used this feature before, but I
assume that it would allow you to get the actual password via LDAP.
Jared Jennings
Senior Systems Architect, Data Technique, Inc.
http://www.datatechnique.com
My Blog and Wiki with Tips, Tricks, and Tutorials
http://jaredjennings.org
Twitter@ jaredljennings

Similar Messages

  • How to get password as string back from encrypted password byte array.

    Hi All,
    I am storing encrypted password and enc key in the database.(Code included encryptPassword method for encryption and validatePassword method for validating of password). Problem is that for some reason i need to show user's password to the user as a string as he/she entered. But i am not able to convert the encrypted password from D/B to original String.
    Tell me if any body know how to get the string password back from the encrypted password byte array after seeing my existing encryption code.
    //********* Code
    private Vector encryptPassword(byte[] arrPwd)
    try
    // parameter arrPwd is the password as entered by the user and to be encrypted.
    byte[] encPwd = null;
    byte[] key = null;
    /* Generate a key pair */
    KeyPairGenerator keyGen = KeyPairGenerator.getInstance("DSA", "SUN");
    SecureRandom random = SecureRandom.getInstance("SHA1PRNG", "SUN");
    keyGen.initialize(1024, random);
    KeyPair pair = keyGen.generateKeyPair();
    PrivateKey priv = pair.getPrivate();
    PublicKey pub = pair.getPublic();
    /* Create a Signature object and initialize it with the private key */
    Signature dsa = Signature.getInstance("SHA1withDSA", "SUN");
    dsa.initSign(priv);
    /* Update and sign the data */
    dsa.update(arrPwd, 0, 12);
    /* Now that all the data to be signed has been read in, generate a signature for it */
    encPwd = dsa.sign();
    /* Now realSig has the signed password*/
    key = pub.getEncoded();
    Vector vtrPwd = new Vector(2);
    vtrPwd.add(encPwd);
    vtrPwd.add(key);
    return vtrPwd;
    catch (Exception e)
    private boolean validatePassword(byte[] arrPwd,byte[] encPwd,byte[] key) throws RemoteException
    try
    // arrPwd is the byte array of password entered by user.
    // encPwd is the encrypted password retreived from D/B
    // key is the array of key through which the password was encrypted and stored.
    X509EncodedKeySpec KeySpec = new X509EncodedKeySpec(key);
    KeyFactory keyFactory = KeyFactory.getInstance("DSA", "SUN");
    PublicKey pubKey = keyFactory.generatePublic(KeySpec);
    /* Encrypt the user-entered password using the key*/
    Signature sig = Signature.getInstance("SHA1withDSA", "SUN");
    sig.initVerify(pubKey);
    /* Update and sign the password*/
    sig.update(arrPwd, 0, 12);
    return sig.verify(encPwd);
    catch (Exception e)
    Help upto any extent would be appreciated.
    Thanx
    Moti Singh

    Hi All,
    I am storing encrypted password and enc key in the
    database.(Code included encryptPassword method for
    encryption and validatePassword method for validating
    of password). Problem is that for some reason i need
    to show user's password to the user as a string as
    he/she entered. But i am not able to convert the
    encrypted password from D/B to original String.No, you are not encrypting the password in your code, you are merely signing it.
    Tell me if any body know how to get the string
    password back from the encrypted password byte array
    after seeing my existing encryption code.It is impossible to retrieve the original text out of a signature.
    You should read up on some encryption basics in order to understand the difference between signing and encrypting. Then you can find examples of how to encrypt something here: http://java.sun.com/j2se/1.4/docs/guide/security/jce/JCERefGuide.html.
    Actually there is one class specifically for keeping keys secure, KeyStore http://java.sun.com/j2se/1.4/docs/api/java/security/KeyStore.html
    - Daniel

  • How to get return value from Java runtime.getRuntime.exec?

    I'm running shell commands from an Oracle db (11gr2) on aix.
    But, I would like to get a return value from a shell comand... like you get with "echo $?"
    I use a code like
    CREATE OR REPLACE JAVA SOURCE NAMED common."Host" AS
    import java.io.*;
    public class Host {
      public static int executeCommand(String command) {
        int retval=0;
        try {
            String[] finalCommand;
            finalCommand = new String[3];
            finalCommand[0] = "/bin/sh";
            finalCommand[1] = "-c";
            finalCommand[2] = command;
          final Process pr = Runtime.getRuntime().exec(finalCommand);
          pr.waitFor();
       catch (Exception ex) {
          System.out.println(ex.getLocalizedMessage());
          retval=-1;
        return retval;
    /but I do not get a return value... because I don't know how to get return value..
    Edited by: user9158455 on 22-Sep-2010 07:33

    Hi,
    Have your tried pr.exitValue() ?
    I think you also need a finally block that destroys the subprocess
    Regards
    Peter

  • How to get the parameter from Java Script into the Parameter crystal Report

    Hi All,
    Crystal Report is integrated with Oracle 10g. I created the base SQL query for col1, col2, col3 and col4. Java Script pass parameter value (185) to Col1.
    My question is how to create crystal report to make Col1 as parameter and how to get the parameter value 185(Col1) from Java Script. Is there any additional code I need to include in the crystal report?
    FYI.
    Java script sends the right parameter value.There is no issue in java script.
    This is an automatic scheduled process when batch runs, Java script should pass the parameter value and the crystal report should get the value and produce the output report.

    Not sure if this is an application question or if you are trying to hook into Crystal Reports parameter UI? If the later then no option other than report design. If an application then I can move this to the Java Forums.
    If you are asking how to alter the parameters I suggest you remove the Java reference and post a new question so it's not confusing the issue.
    Please clarify?

  • How to get password of a logged in portal user in webdynpro.

    hi,
    i want to get the password of the logged in portal user through webdynpro. i already know how to get the user id and other information through webdynpro (using WDClientUser), but i want to get the password as well.
    this is an urgent requirement. Immediate help will be highly appreciated and points will be awarded for helpful answer.
    thanks in advance.

    Hi
    User Management APIs don't give the liberity to obtain the password, instead you can verify a password. Please check if your requrirement can be modified to check for password.
    Please use code mentioned below and the one suggested before.
    loggedInUser = WDClientUser.getCurrentUser();
    user = loggedInUser.getSAPUser();
    if (user != null)
    IUserAccount[] acct = user.getUserAccounts();
    if(acct[0] != null)
    b = acct[0].checkPassword(password);
    Thanks
    Srikant

  • How to get passwords working in Pages documents?

    I've set a pages document to require a password to open. When I open the file, it opens without requiring this password. Any thoughts on how to get the password working? The doc is on icloud, could that be a factor?

    Finally, I've added a new field movement in transaction GCF2 with sender tables ACCHD, ACCIT_GLX AND ACCCR. The joint venture name comes only from FI documents and not JVA documents, so, only JVA information of P&L accounts is available.
    Best regards,
    Alfredo Del Portillo

  • How to get rid of the java update virus?

    Everytime i go on a web page something pops up saying to install Java Runtime Environment in order to web content and it gives me the option to click more info (to go to the page to download the Java Runtime Environment) OR ok. Before i clicked ok until it continued to pop and and began to annoy me so i decided to install it. It still pops up and won't go away. I found out it is a virus and i don't know how to get rid of it.
    PLEASE HELP!

    Most likely, you have a web plugin that depends on the Java runtime distributed by Apple, such as the Facebook video calling plugin or the "NexDef" plugin for watching baseball streams. If you no longer need the plugin, remove it. Otherwise, install Java.

  • How to get rid of the java icon on the window

    There is a java icon(top right habd corner) on every window panel.
    How to get rid of it?

    What r u using, AWT r JAVA Swing? would please explain
    ur problem clearlyLOL. No offense, but you might consider phrasing your responses clearly as well...
    r == "are" || r == "or" || r == "argh" :o)
    §

  • How to get printer IPAddress using java code

    Hi all,
    Can some one suggest in java
    1) how to get printer IPaddress
    2) send a printer job to a particular printer either by using printer name or by printer IPaddress ?

    Hi all,
    Can some one suggest in java
    1) how to get printer IPaddress
    2) send a printer job to a particular printer either by using printer name or by printer IPaddress ?

  • How to get stylesheet object from JAVA RESOURCE stored in DB

    Hi,
    I stored a xslt file in the database and have a JAVA RESOURCE file now. How can i get a stylesheet object from this resource file?
    I took the following class to get an impression how to get the contents of the resource but -although the name of the resource was spelled correctly- i got a file not found exception.
    Whats wrong?
    public class PrintRessource {
    public static void print (String p_ressource){
    try {
    Class c = PrintRessource.class;
    System.out.println(c.toString());
    InputStream file = c.getResourceAsStream(p_ressource);
    if (file == null)
    throw new FileNotFoundException("XSLT file not in DB");
    byte[] buffer = new byte[4096];
    int bytes_read;
    while ((bytes_read = file.read(buffer)) != -1)
    System.out.println(new String(buffer, 0 , buffer.length));
    catch (Exception exp) {
    System.out.println(exp);
    Thanks

    The code works as is. I just forgot to add the slash in front of the Resource file name.

  • af:chooseDate - how to get selected month in java class

    <af:chooseDate id="choose_date_ID"
    binding="#{EventsBackingBean.choose_date_ID}">
    </af:chooseDate>
    in adf ,how to get the selected month value in the component.
    and if we change the the month from the drop down,then again new value should be reflected in java class.

    Hi Hoque,
    As per the documentation of af:choose at http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e12419/tagdoc/af_chooseDate.html
    "In order to indicate that a particular inputDate should be updated in response to chooseDate selection changes, the the inputDate's "chooseId" attribute must be set to the id of the associated chooseDate component.ts mentioned that the the af:choose "
    So, i believe that if you can create a binding to the af:inputDate component in your backing bean, you can extract the newly selected date in a ValueChangedListener using the getValue() function on the bound component.
    private RichInputDate chooseDateInput;
        public void setChooseDateInput(RichInputDate chooseDateInput) {
            this.chooseDateInput = chooseDateInput;
        public RichInputDate getChooseDateInput() {
            return chooseDateInput;
        public void chooseDateInput(ValueChangeEvent valueChangeEvent) {
          Date selectedDate = (Date)chooseDateInput.getValue();
        }Regards,
    Ryan

  • How to get SEO url in java

    Hi
    My requirement is to generate a product feed which has its product url as one of the fields.
    Now does anybody know how to get the SEO url of a product in a java file.
    I know form front end we generate it via ItemLinkDroplet.
    But is there a way i can generate it in my java class?
    Thanks

    Assuming you have used ATG SEO Repository and ATG DirectUrlTemplate and IndirectUrlTemplate etc..for SEO URL generation.
    Now, create a standalone jsp, example, seolinkbuilder.jsp.
    Let it take following parameters,
    productId
    categoryId
    brandId
    siteId
    and any other ids as needed by your application.
    Suppose you just needed SEO url for a given product id.
    /contextpath/seolinkbuilder.jsp?productId=12345
    The JSP would contain a droplet which would construct a SEO url and set it as oparam which can be written to JSP.
    Finally, from an independent JAVA program, using Apache HTTPClient API, call seolunkbuilder.jsp by passing productId. Read the response for SEO url.
    Let me know if you have further questions.

  • How to get applets running with Java Plug-in on Win but also on Mac OS X???

    I've converted to the use of Java Plug-in for my applets, but I need to have those same applets executable from browsers on Mac OS X platform. Surely this has been done, but I don't see how. The browsers I've tried on Mac OS X (Netscape, IE) don't seem to recognize the <OBJECT> tag used for the java plug-in. I've seen no news about the Java plug-in being ported to Macs. How can one get the same applet to run with the Java plug-in on Windows browsers, and also to run with at least one of the common browsers on Mac OS X? Any help would be SO much appreciated!

    Those ten dukes look good to me. But the passing of fifteen months has me thinking you've probably moved on. In any case, here's my effort.
    I've been through a trial trying to get my applet, developed with 1.4.1_03, to run on my Mac OS X v.10.2.6 in multiple browsers. I'm posting my results here. Comments and feedback are welcome.
    JVM support for 1.4.1 is limited to the Safari browser. All other browsers running in Mac OS X that I've tried ( Camino, Opera, Internet Explorer, Mozilla ) are using the 1.3.1 plugin. According to a bug report by Mozilla on this topic ( see Bugzilla Bug # 197813 http://bugzilla.mozilla.org/show_bug.cgi?id=197813 )
    with the release of Apple's version of Sun's Java 1.4.1 the applet programming model has changed, and only Safari has adapted with this change. Other browsers, according to the report, could not because of a lack of documentation. The use of the MRJCarbon plugin offered by Mozilla (here - http://www.mozilla.org/oji/MRJPluginCarbon.html) only allows Mozilla to use the J 1.3.1. And I have not found any information on the Microsoft site about how to get IE 5.2 to recognize the newer version of Java.
    Regarding the use of the OBJECT tag in Safari, it is a matter of debate. A current post on this topic exists in the Applet Development forum:
    http://forum.java.sun.com/thread.jsp?forum=421&thread=441002
    In my experience, I have not been able to determine that Safari v1.0 recognizes the OBJECT tag. My experience is that the APPLET tag is required to run applets in Safari. The Bugzilla report echoes the problem with the BadMagicNumber error that can arise in Safari. Nonetheless, I enjoy Safari and I enjoy Mac OS X.

  • How to get php content with java ??

    i have made a php file what will display a number,
    here's a example
    <?php
    if ($action == "answer"){
    echo "18274926";
    ?>
    no i want to get the number with java
    so here's my java code
    import java.io.*;
    import java.net.*;
    import java.util.Date;
    class URLConnecties
        public static void main(String args[]) throws Exception
            int teken;
            URL url = new URL("http://www.gamer.mineurwar.nl/net/javachallenge.php?command=DaTe");
            URLConnection urlconnection = url.openConnection();
            System.out.println("Type inhoud: " +
                urlconnection.getContentType());
            System.out.println("Datum document: " +
                new Date(urlconnection.getDate()));
            System.out.println("Laatst gewijzigd: " +
                new Date(urlconnection.getLastModified()));
            System.out.println("Document vervalt: " +
                urlconnection.getExpiration());
            int lengteinhoud = urlconnection.getContentLength();
            System.out.println("Lengte inhoud: " + lengteinhoud);
            if (lengteinhoud > 0) {
                InputStream in = urlconnection.getInputStream();
                while ((teken = in.read()) != -1) {
                    System.out.print((char) teken);
                in.close();
    }if you change the url ro a .html file it displays the code correctly(source),
    but when trying to get the content of a php file (the number)
    it says that there is no content from the php file
    yhe source of the original php file what's in the code can be found at
    www.gamer.mineurwar.nl/net/javachallenge.txt

    The 'content' is generated dynamically by a PHP script so the "content lenght" can't be known in advance by the server. For this reason connection.getContentLenght() returns -1; it doesn't mean that there is no content, only that it can't be known how much there will be.
    To solve the issue, remove the if statement from around the while-loop:// if (lengteinhoud > 0) { DELETE THIS LINE
    InputStream in = urlconnection.getInputStream();
    while ((teken = in.read()) != -1) {
        System.out.print((char) teken);
    // } and this too

  • How i get hardware info with Java Applet

    Hello Everybody.
    first I am sorry for my english. This my first topic. I am a php developer and learning Java. I am developing a Java Applet.
    Can i get client hardware info with Java Applet
    Ýf i can How i do get hardware info with Java Applet.
    I need sample code or documentation.
    Thanx.

    TrojanMyth wrote:
    Hello;
    Can i get hardware info with Java ?? Have not a know people ?Applets are restricted, unless, as already noted, they are signed and accepted by the user. See
    http://java.sun.com/docs/books/tutorial/deployment/applet/security.html
    http://java.sun.com/docs/books/tutorial/deployment/applet/properties.html
    In general, since Java is designed to run on multiple operating systems and machine architectures it does not provide much access to the underlying hardware. As mentioned, you can access the os via methods in the java.lang.ProcessBuilder and Runtime classes.

Maybe you are looking for

  • How do I show file size in the Finder icon view for images?

    How can I add the file size to the icon view "File Info" for images? I know how to get it to display the image size under View Options. In this mode it shows pixel dimensions for some images (not for svg or pdfs tho) and file size for some non-images

  • How to find out what is the lock key for the computer

    How to find out what is the lock key for the computer?

  • Correlationid in ccBPM in stopped bpm's

    Hi, We use PI ccBPM to coordinate between several async services. Each service is called async and a deadline (timeout) is opened waiting for it to callback async. The receiver is configured with a correlation id so that the correct bpm context is re

  • Stop cf server from processing particular files

    Bit of a strange question this. I want to stop coldfusion server processing certain .cfm files in the root of my site, i want them to get processed by IIS as plain html. Is this possible? i guess its more of an iis question.

  • AFP crashing intermittently

    Hi -- I've read about similar issues on this and other forums, but nothing seems to be working. I inherited an Xserve with three volumes that is running Mac OS X Server last fall. There has rarely been an issue with it...but within the last month, AF