dongmeng1868
2016-12-30 02:34
浏览 260
已采纳

在laravel中URL加密的方式是什么?

I am passing the POST Id values through the URL like this

localhost:81/laravel/public/Application/1956458 

So I would like to encrypt the Keys in the address bar. How can i achieve that?

图片转代码服务由CSDN问答提供 功能建议

我通过URL传递POST Id值,如此

 <  code> localhost:81 / laravel / public / Application / 1956458 
   
 
 

所以我想加密地址栏中的Keys。 我怎样才能实现这一目标?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • duanshan1856 2016-12-30 02:35
    已采纳

    There are some different ways to Encrypt your password,

    1. Normal Encryption.

    This is a strong AES encryption via the Mcrypt PHP extension,

    $encrypted = Crypt::encrypt($id);
    

    And also you can decrypt this encrypted values using this command,

    $decrypted = Crypt::decrypt($encrypted);
    

    2. Hashing A Password Using Bcrypt in Laravel.

    This will create a hashed password. You may use it in your controller or even in a model.

    $encrypted = Hash::make($id);
    

    3. Direct Use Bcrypt.

    In Laravel 5 you can directly encrypt the password using Bcrypt,

    $encrypted = bcrypt($id);     
    
    点赞 评论
  • dragonlew9876 2016-12-30 04:09

    Use this code to encrypt and decrypt

    $encrypt_val = Crypt::encrypt($value);
    $decrypt_val = Crypt::decrypt($encrypt_val );
    

    when you use decrypt please insertuse Illuminate\Contracts\Encryption\DecryptException;

    点赞 评论

相关推荐 更多相似问题