very similar keys generated

Andre Charbonneau <[email protected]>
Newsgroups gmane.comp.java.sshtools.user
Message-ID <[email protected]>
Hi,

While working with the j2ssh code that generate public/private key
pairs, I noticed that the public keys generated all have most of the
bits identical.  
For example, here are 3 public keys that where generated by running
the test program 3 times:


ssh-dss
AAAAB3NzaC1kc3MAAACBAP1/U4EddRIpUt9KnC7s5Of2EbdSPO9EAMMeP4C2USZpRV1AIlH7WT2NWPq/xfW6MPbLm1Vs14E7gB00b/JmYLdrmVClpJ+f6AR7ECLCT7up1/63xhv4O1fnxqimFQ8E+4P208UewwI1VBNaFpEy9nXzrith1yrv8iIDGZ3RSAHHAAAAFQCXYFCPFSMLzLKSuYKi64QL8Fgc9QAAAIEA9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCBgLRJFnEj6EwoFhO3zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7zKTxvqhRkImog9/hWuWfBpKLZl6Ae1UlZAFMO/7PSSoAAACACNp4C+sKDt07HEFCxLHYqeGTRebIxdpzIALEDp8x3P8RaII7rUgIRhTZIeWSWXGsDom38WIMAdX5AO8fc6HRGkO8j1uSVFdIZYBkNHxNohPrZ4yWJ7pto0EUW+x0da8YVaORzarnxejO8AwDhBDqWXLRnn1AK2eZii9DZ3lkJKI=andre@arsenic

ssh-dss
AAAAB3NzaC1kc3MAAACBAP1/U4EddRIpUt9KnC7s5Of2EbdSPO9EAMMeP4C2USZpRV1AIlH7WT2NWPq/xfW6MPbLm1Vs14E7gB00b/JmYLdrmVClpJ+f6AR7ECLCT7up1/63xhv4O1fnxqimFQ8E+4P208UewwI1VBNaFpEy9nXzrith1yrv8iIDGZ3RSAHHAAAAFQCXYFCPFSMLzLKSuYKi64QL8Fgc9QAAAIEA9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCBgLRJFnEj6EwoFhO3zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7zKTxvqhRkImog9/hWuWfBpKLZl6Ae1UlZAFMO/7PSSoAAACAAV9qnppq6wgESxrn58TT8FHv909Vo/ueSdlFoKDiFFWqjRQliyWIxvxu/49daUQmzT9ZpuBOF/vOtAaLllGOuPSFKOUs/Bd/hhwVyfROR0IZmKK6uGNN8UmTeJqgq110QLDxd4sCOtGoD4bMwgCaiIp0j/ykYl7FyuNMR5ZA0/s=andre@arsenic

ssh-dss
AAAAB3NzaC1kc3MAAACBAP1/U4EddRIpUt9KnC7s5Of2EbdSPO9EAMMeP4C2USZpRV1AIlH7WT2NWPq/xfW6MPbLm1Vs14E7gB00b/JmYLdrmVClpJ+f6AR7ECLCT7up1/63xhv4O1fnxqimFQ8E+4P208UewwI1VBNaFpEy9nXzrith1yrv8iIDGZ3RSAHHAAAAFQCXYFCPFSMLzLKSuYKi64QL8Fgc9QAAAIEA9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCBgLRJFnEj6EwoFhO3zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7zKTxvqhRkImog9/hWuWfBpKLZl6Ae1UlZAFMO/7PSSoAAACAPE2vQ0W6OeVi38NqohEHVJfikzNTay9gEukexwy2RX67hECdILueA7SEXXevvK5M6dO0hppBI/g/x1v8TbOJFM8dHRzInA/HWj3cbRYh7R3HjwVeVtqIg9ivAODsBph8c7IqykjvVYuj5m/WNNmmPUW+M7SMKkgoV+8teY99CME=andre@arsenic



If you look at the above keys, you will notice that only the end of
the key differs.

Is this normal behavior?  Is there a random seed I can set somewhere
that will make the keys more 'random'?

The code that was used to generate the keys is:

    try
    {
      String keyType = "ssh-dss";
      SshKeyPair pair = SshKeyPairFactory.newInstance(keyType);
      SshKeyPairFactory.initialize();
      pair.generate(1024);
      
      SshPublicKeyFile pub =
      SshPublicKeyFile.create(pair.getPublicKey(),
      new OpenSSHPublicKeyFormat());
      
      System.out.print(pub.toString());
    }
    catch(Exception e)
    {
      log.error(e);
    }



Thanks.
-- 
Andre Charbonneau

100 Sussex Drive, Rm 2025
Research Computing Support, IMSB
National Research Council Canada
Ottawa, ON, Canada K1A 0R6
613-993-3129  Fax: 613-993-3127     


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.