Hello everyone,
I am looking for some help or a plugin that can add a User Id: #.... to all users upon posting.
Let me explain,
I have enabled the guest posting feature, now of course each anonymous poster must be unique....since each member is already unique.
What I would like to see is Every Registered User and Every Anonymous User when they post a message I want the system to check if the IP Address has been logged and ASSIGN a numerical incremental value to User ID: # 1, User ID: # 2, and so on...
Probably easier just to hash/encrypt the IP address and display that rather than some incremental thing.
But users on dynamic IPs will have multiple identities anyway.
(05-22-2011 09:01 AM)ZiNgA BuRgA Wrote: [ -> ]Probably easier just to hash/encrypt the IP address and display that rather than some incremental thing.
But users on dynamic IPs will have multiple identities anyway.
Hi ZiNgA,
Yes, I know.....I already tried
Quote:$post['uid'] = ip2long($post['ipaddress']);
in
functions_post.php. But the problem I have is that the number shown is reversible with online tools....thereby exposing every ones IP Address. Not cool at all.
How about can ip2long be encrypted further?
ip2long doesn't encrypt or hash the IP, so yes, it's completely reversable.
Hashing functions would mainly be md5() and sha1(). As these are long, you may wish to truncate the hashes a bit. Be sure to add in a "salt" or static unquifier unknown to the user, otherwise these hashes will also be reversable.
Some sites just hide the last two octets of the IP address. That may also be a solution which may work a bit better with dynamic IPs, at the cost of being less unique.
(05-22-2011 09:45 AM)ZiNgA BuRgA Wrote: [ -> ]ip2long doesn't encrypt or hash the IP, so yes, it's completely reversable.
Hashing functions would mainly be md5() and sha1(). As these are long, you may wish to truncate the hashes a bit. Be sure to add in a "salt" or static unquifier unknown to the user, otherwise these hashes will also be reversable.
Some sites just hide the last two octets of the IP address. That may also be a solution which may work a bit better with dynamic IPs, at the cost of being less unique.
Ok Thanks,
I'm going to do some more research on this issue. I know that what I want, has been done already, I just don't know How.
Here's my example:
Godlike Productions
The reason I like it so much is that is short and sweet, no 34 characters, weird characters, just straight sequential numbers.
Every user id is based upon a unique ip address so no 2 are alike, including registered members. It's a custom system obviously, I just love to duplicated.
Well, if you're willing to put the effort to make a sequential number system, be my guest.
Hide last two octets:
PHP Code:
long2ip(ip2long($post['ipaddress']) & 0xFFFF0000)
|
Hash:
PHP Code:
substr(sha1($post['ipaddress'] . substr($mybb->settings['internal']['encryption_key'], 0, 8)), 0, 8)
|
Quite simple really.