-1

I am working in a project in Rails 4.

localhost:3000/employees/view

How may I encrypt the url which is coming in browser in rails for whole application. Whichever link I click, the url must be encrypted as showing the url of the page may be unsafe as its displaying the name of the table. So please help.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Mahesh Sharma
  • 221
  • 1
  • 13

1 Answers1

0

may be unsafe as its displaying the name of the table

That's a popular myth among inexperienced developers. Url obfuscation makes the site unusable to humans (they now can't tell one page from another), will complicate your code immensely and, most importantly, will not add any security.

I mean, if you have a blog site, for example, one can assume, with high degree of confidence, that you have a table named posts. Now we're back to square one, only now we have ugly urls.

If your concern is security of your site, I suggest that you learn proper techniques and tools/libraries for authentication, authorization, etc.

Here's the official recommendation: Avoid Security by Obscurity.

Sergio Tulentsev
  • 226,338
  • 43
  • 373
  • 367