Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7159765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:17:08+00:00 2026-05-28T13:17:08+00:00

I need help on coming up with a strategy to handle object ids in

  • 0

I need help on coming up with a strategy to handle object ids in a PHP/MySQL application I’m working on. Basically, instead of having a URL look like this:

/post/get/1

I’m looking for something like:

/post/get/92Dga93jh

I know that security-through-obscurity is useless (I have an ACL system in place to handle security) but I still need to obscure the ids. This is where I’m stuck.

I thought about generating a separate public id for each DB row but have been unable to find a way to create truly unique ids.

I suppose I could encrypt and decrypt a MySQL auto increment row id as it leaves and enters my app, but I’m not sure how ‘expensive’ PHP’s encryption and decryption methods are. Additionally, I need to make sure that the obscured id remains unique so that it doesn’t decrypt into the wrong value.

Also, since my domain objects are related to each other, I want to avoid any unnecessary strain on MySQL if I decide to go with generating and storing an obscure id in the tables.

I’m beating my head against the wall because I feel like this is a common scenario, yet can’t figure out what to do. Any help is greatly appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T13:17:08+00:00Added an answer on May 28, 2026 at 1:17 pm

    I’d just use a salted md5. It’s secure for 99% of the cases. The other 1% will be when you are wacking your head on the wall cause you got your data stolen by a pro-hacker and it becomes critical to minimize the impact of it.

    So:

    $sql = 'SELECT * FROM my_table WHERE MD5(CONCAT(ID, "mysupersalt")) = "'.$my_checked_url_value.'"';
    

    And generating the same thing from PHP can be done using similar strategy:

    <a href="/link/to/mypage/<?php echo md5($id.'mysupersalt'); ?>"> link text </a>
    

    Hope this is what you’re looking for..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

need your help with PHP templating. I'm new to PHP (I'm coming from Perl+Embperl).
i need help with disk_total_space function.. i have this on my code <?php $sql=select
i need help, i have some data coming in xml, i want to make
Sorry for my Noobness with Excel/Vba... coming from a unix world...I need help! I
Need your help in over coming the following issues. i need to send opt-in
Need a little help getting the following rule working: RewriteCond %{HTTP_HOST} ^asset.*.domainone\.com [NC,AND] RewriteCond
I need your help., How to pass the array values in query string... <?php
I am new to PHP and need your help here. I know the basic
I need to re-architect a PHP application that is entirely procedural. Pretty much every
I need help coming up with a way of executing the following sequence using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.