Encrypted values in a column

Encrypted values in a column

goktuginal41@gmail.comgoktuginal41@gmail.com Posts: 57Questions: 22Answers: 0
edited April 2023 in Free community support

Hello everyone,

I have one problem. I want the values in the Patient ID column to be hidden, may be 'xxx' or be seen as encrypted(security issue), but at the same time, when I search with the search filter; For example, I want to reach the row with the value of Patient ID is 11. Is it possible to do this? Thanks in advance.

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Yep, you can use columns.render, just change the option for display. I'm not that allowing the search to match though would honour the security level of that field, unless I'm missing something,

    Colin

  • goktuginal41@gmail.comgoktuginal41@gmail.com Posts: 57Questions: 22Answers: 0

    Hi Colin,

    Thank you for the respond. Yes, it is not that secure with that way :) Just trying to do something.How can I use columns.render in my code below? I'll be appreciated if you help me.

    Note: p_id_s is Patient ID and there are many data, I'm just sharing the one

    columns: [
                {"data": null,
                  render: function ( data, type, row ) {
                    return '<a class="btn btn-outline-success text-center" id="edit" title="Edit row" data-bs-toggle="modal" data-bs-target="#editModal"><i class="fa-solid fa-pen-to-square" style="color:green !important;"></i></a>';
                  }
                },
                { data: 'p_id_s'},
             ],
    
  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Answer ✓

    I would strongly suggest that you don't do the encryption on the client-side. What's the point - you'd be transmitting the unencrypted data over the wire, so anyone could pop open their browser's dev tools and see the unencrypted data. Worse, your encryption key would need to able available on the client-side to do the encryption.

    If you need to encrypt the data and want to show the end user the encrypted data (?) then do the encryption on the server-side. You wouldn't then be able to search on that field though.

    If you just want to search on that column's data, but not display it, then use columns.visible to hide the column. I'm wondering if "encryption" is the wrong term here. You are looking to obfuscate it - i.e. hide it from the end user (even although they can search on it?).

    Allan

Sign In or Register to comment.