Encrypt Decrypt in Codeigniter - Insert Data

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 ม.ค. 2025

ความคิดเห็น • 16

  • @YudiKondo
    @YudiKondo 6 ปีที่แล้ว

    Good tutorial! For me all personal data need to be encrypted! Tnks!

  • @stemi5601
    @stemi5601 6 ปีที่แล้ว +2

    Hi Man, How did you generate the encryption KEY? Is it random generation? I'm talking about the key you wrote in $config['encrypt'] in the config file

    • @limitedlifetime8443
      @limitedlifetime8443 5 ปีที่แล้ว

      $this->encryption->create_key(16)

    • @_U_will_always_shine
      @_U_will_always_shine 4 ปีที่แล้ว

      You can find it in codegnitor encryption keys ;.type that and search you will get codegnitor page.

  • @SeveBarnett
    @SeveBarnett 4 ปีที่แล้ว

    Hello. Very nice tutorial. In creating the database, what are the length/values of the fields? How many characters will the inserted encrypted texts will be? Thanks.

  • @FM-rn4ti
    @FM-rn4ti 6 ปีที่แล้ว +1

    Amazing tutorial sir....😊😊
    Sir pls make video on how to use user agent in codeigniter and make that project view in desktop as well as mobile as I am facing problem and I didn't found any perfect tutorial in youtube yet. . plss make a tutorial on this soon ..pls sir..I will be waiting for ur next tutorial

  • @socheyapi4998
    @socheyapi4998 2 ปีที่แล้ว

    Can you encrypt and decrypt url in codeigniter?

  • @sinha95
    @sinha95 5 ปีที่แล้ว

    A very nice video. I have one query, should we encrypt all fields in a signup form and store to db?,

  • @vandanaverma6371
    @vandanaverma6371 6 ปีที่แล้ว +1

    Nice tutorial sir ,make a mini project for admin and front end site pls sir

  • @FM-rn4ti
    @FM-rn4ti 6 ปีที่แล้ว

    Sir can I upload your channel videos in my Educational Web application where students can watch your TH-cam videos directly from the website and your channel name will be promoted on our website too...so can I do this so?

  • @Yudibilly
    @Yudibilly 6 ปีที่แล้ว +1

    Good job

  • @FM-rn4ti
    @FM-rn4ti 6 ปีที่แล้ว +1

    Sir can u please make a videos series on -Building resume website using codeigniter.....? Plss sir bring one video on this as it is no where in TH-cam ...

  • @faizzulfikar3692
    @faizzulfikar3692 6 ปีที่แล้ว

    but, how to make that encryption key in config.php.?

    • @YudiKondo
      @YudiKondo 6 ปีที่แล้ว

      echo bin2hex($this->encryption->create_key(16));
      Copy and past
      $config['encryption_key'] = hex2bin();

    • @faizzulfikar3692
      @faizzulfikar3692 6 ปีที่แล้ว

      @@YudiKondo i don't undestand how "echo bin2hex($this->encryption->create_key(16));" are works
      but i tried,
      $str = bin2hex("key");
      echo($str);
      and encoded key are shown.

    • @YudiKondo
      @YudiKondo 6 ปีที่แล้ว

      @@faizzulfikar3692 here www.codeigniter.com/user_guide/libraries/encryption.html
      Encryption Library:
      The key should be as random as possible and it must not be a regular text string, nor the output of a hashing function, etc. In order to create a proper key, you must use the Encryption library’s create_key() method
      // $key will be assigned a 16-byte (128-bit) random key
      $key = $this->encryption->create_key(16);
      The key can be either stored in your application/config/config.php, or you can design your own storage mechanism and pass the key dynamically when encrypting/decrypting.
      To save your key to your application/config/config.php, open the file and set:
      $config['encryption_key'] = 'YOUR KEY';
      You’ll notice that the create_key() method outputs binary data, which is hard to deal with (i.e. a copy-paste may damage it), so you may use bin2hex(), hex2bin() or Base64-encoding to work with the key in a more friendly manner. For example:
      // Get a hex-encoded representation of the key:
      $key = bin2hex($this->encryption->create_key(16));
      // Put the same value in your config with hex2bin(),
      // so that it is still passed as binary to the library:
      $config['encryption_key'] = hex2bin();