Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #18859

Re: get hexadecimal hash string for a number

From Magnus Warker <warker@mailinator.com>
Newsgroups comp.lang.java.programmer
Subject Re: get hexadecimal hash string for a number
Date 2012-09-20 11:30 +0200
Organization albasani.net
Message-ID <k3enr5$idj$1@news.albasani.net> (permalink)
References <k3a74r$u3s$1@news.m-online.net> <rjsj5819nsu0b14umojnd9bje44u7ttcae@4ax.com>

Show all headers | View raw


> As has been pointed out, integers are already unique.  Just decide on
> a large enough fixed size and zero pad the small numbers:
> 0000000000001

> If you want to disguise the actual number you are using, which is what
> I take your mention of "hash" to mean, then you need an encryption.
> Each unique input gives a unique output.  It has to be unique,
> otherwise you couldn't decrypt it reliably.

What about Kevin's posting? He noted that encrypting sequential numbers 
would reveal the encryption key?

> For 64 bit numbers, just use DES and encrypt the numbers 0, 1, 2, 3,
> ... n in turn.  For 128 bits use AES.

Could you please explain this? I haven't used encryption in Java, but I 
would expect that the encryption method should be independend of the 
size of the data to encrypt?

> Again, you will need to be sure that your chosen bit size will
> acommodate enough users, with plenty to spare for keeping the gaps
> numerous enough.

Well, I would simply choose the size of SQL standard integer (64)...

Magnus

-- 
This is Unix-Land. In quiet nights, you can hear the Windows machines 
reboot.

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

get hexadecimal hash string for a number Magnus Warker <magnux@mailinator.com> - 2012-09-18 18:25 +0200
  Re: get hexadecimal hash string for a number markspace <-@.> - 2012-09-18 10:08 -0700
    Re: get hexadecimal hash string for a number Lew <lewbloch@gmail.com> - 2012-09-18 10:14 -0700
    Re: get hexadecimal hash string for a number Arne Vajhøj <arne@vajhoej.dk> - 2012-09-18 19:58 -0400
      Re: get hexadecimal hash string for a number markspace <-@.> - 2012-09-18 17:27 -0700
        Re: get hexadecimal hash string for a number Arne Vajhøj <arne@vajhoej.dk> - 2012-09-18 21:17 -0400
        Re: get hexadecimal hash string for a number Arne Vajhøj <arne@vajhoej.dk> - 2012-09-18 21:21 -0400
      Re: get hexadecimal hash string for a number Magnus Warker <warker@mailinator.com> - 2012-09-19 08:27 +0200
        Re: get hexadecimal hash string for a number Arne Vajhøj <arne@vajhoej.dk> - 2012-09-19 18:30 -0400
        Re: get hexadecimal hash string for a number Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2012-09-19 19:06 -0700
          Re: get hexadecimal hash string for a number Magnus Warker <warker@mailinator.com> - 2012-09-20 11:32 +0200
  Re: get hexadecimal hash string for a number Lew <lewbloch@gmail.com> - 2012-09-18 10:10 -0700
    Re: get hexadecimal hash string for a number Arne Vajhøj <arne@vajhoej.dk> - 2012-09-18 20:02 -0400
    Re: get hexadecimal hash string for a number Magnus Warker <warker@mailinator.com> - 2012-09-19 08:18 +0200
  Re: get hexadecimal hash string for a number Roedy Green <see_website@mindprod.com.invalid> - 2012-09-18 10:23 -0700
    Re: get hexadecimal hash string for a number Arne Vajhøj <arne@vajhoej.dk> - 2012-09-18 20:00 -0400
  Re: get hexadecimal hash string for a number Arne Vajhøj <arne@vajhoej.dk> - 2012-09-18 20:06 -0400
    Re: get hexadecimal hash string for a number markspace <-@.> - 2012-09-18 17:30 -0700
      Re: get hexadecimal hash string for a number Arne Vajhøj <arne@vajhoej.dk> - 2012-09-18 21:07 -0400
  Re: get hexadecimal hash string for a number Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2012-09-18 22:50 -0700
  Re: get hexadecimal hash string for a number Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-09-19 01:06 -0500
  Re: get hexadecimal hash string for a number rossum <rossum48@coldmail.com> - 2012-09-19 17:34 +0100
    Re: get hexadecimal hash string for a number Magnus Warker <warker@mailinator.com> - 2012-09-20 11:30 +0200
      Re: get hexadecimal hash string for a number rossum <rossum48@coldmail.com> - 2012-09-21 12:48 +0100
        Re: get hexadecimal hash string for a number Lew <lewbloch@gmail.com> - 2012-09-21 10:15 -0700
          Re: get hexadecimal hash string for a number Magnus Warker <warker@mailinator.com> - 2012-09-26 06:11 +0200
            Re: get hexadecimal hash string for a number Arne Vajhøj <arne@vajhoej.dk> - 2012-09-26 09:29 -0400
              Re: get hexadecimal hash string for a number Gene Wirchenko <genew@ocis.net> - 2012-09-26 09:18 -0700
      Re: get hexadecimal hash string for a number markspace <-@.> - 2012-09-21 10:56 -0700
        Re: get hexadecimal hash string for a number Magnus Warker <warker@mailinator.com> - 2012-09-26 06:12 +0200
      Re: get hexadecimal hash string for a number Arne Vajhøj <arne@vajhoej.dk> - 2012-09-23 20:57 -0400

csiph-web