Actions

Data encryption: Difference between revisions

From LimeSurvey Manual

No edit summary
mNo edit summary
Line 1: Line 1:
{{Alert| New LS4 feature}}
 


__TOC__
__TOC__
{{Note|'''Data encryption''' is a LimeSurvey 4+ feature.}}


==Introduction== <!--T:1-->
==Introduction== <!--T:1-->
Line 15: Line 19:




LimeSurvey use [https://github.com/paragonie/sodium_compat Sodium Compat] library to bridge with different PHP versions.
LimeSurvey uses the [https://github.com/paragonie/sodium_compat Sodium Compat] library to bridge with different PHP versions.
This library tentatively supports PHP 5.2.4 - 7.x (latest), but officially only supports [http://https://secure.php.net/supported-versions.php non-EOL'd versions of PHP].
This library tentatively supports PHP 5.2.4 - 7.x (latest), but officially it only supports [https://https://secure.php.net/supported-versions.php non-EOL'd versions of PHP].




Line 22: Line 26:




'''Warning!!!'''
{{Alert|title=Warning|text=Once data encryption is turned on, data in corresponding database columns would become unreadable without decrypting them first. '''You should always have a backup of your encryption keys in case they get deleted'''.
 
Also, once encryption keys are set, you should never change them because it would make all existing data unusable.
Once data encryption is turned on, data in corresponding database columns would be unreadable without first being decrypted.
You should always have a backup of your encryption keys in case they get deleted.
Also, once encryption keys are set, you should never change them, because it would make all existing data unusable.




Line 32: Line 33:




==Settings== <!--T:2-->
There are three places in LimeSurvey where data encryption settings can be set: question attributes, participant attributes, and central participant database attributes.




==Settings== <!--T:2-->
There are three places in LimeSurvey where data encryption settings can be set: question attributes, participant attributes and central participant database attributes.
===Question attributes===
===Question attributes===
Question attribute "Encrypted" is used to enable data encryption for corresponding responses. This attribute is '''turned off''' by default. Once survey is activated, it is not possible to change this attribute.
Question attribute "Encrypted" is used to enable data encryption for corresponding responses. This attribute is '''turned off''' by default. Once survey is activated, it is not possible to change this attribute.
<center>[[File:Question attributes.png]]</center>
<center>[[File:Question attributes.png]]</center>


===Participant attributes===
===Participant attributes===
Three core attributes (firstname, lastname and email) are always shown in attribute table and encryption is '''turned on''' by default.
Three core attributes (firstname, lastname, and email) are always shown in the [[Survey_participants|survey participants table]], encryption being '''turned on''' by default.
 
Each new participant attribute will have encryption '''turned off''' by default.
Each new participant attribute will have encryption '''turned off''' by default.
Encryption can be turned on or off at any moment.  
 
Encryption can be turned on or off at any moment.
 
 
<center>[[File:Manage attribute fields.png|800px]]</center>
<center>[[File:Manage attribute fields.png|800px]]</center>


===Central participant database attribute management===
===Central participant database attribute management===
Three core attributes (firstname, lastname and email) are always shown in attribute table and encryption is '''turned on''' by default.
Three core attributes (firstname, lastname and email) are always shown in the [[Central_Participant_Database|central participant database]], encryption being '''turned on''' by default.
 
Each new participant attribute will have encryption '''turned off''' by default.
Each new participant attribute will have encryption '''turned off''' by default.
Encryption can be turned on or off at any moment.  
Encryption can be turned on or off at any moment.  
<center>[[File:Cpdb attribute management.png|800px]]</center>
<center>[[File:Cpdb attribute management.png|800px]]</center>

Revision as of 13:26, 11 April 2019



Data encryption is a LimeSurvey 4+ feature.


Introduction

Sodium library is used to provide data encryption and decryption functionality for LimeSurvey.

Sodium is a modern, easy-to-use software library for encryption, decryption, signatures, password hashing and more. It is a portable, cross-compilable, installable, packageable fork of NaCl, with a compatible API, and an extended API to improve usability even further. Its goal is to provide all of the core operations needed to build higher-level cryptographic tools.


Sodium is cross-platforms and cross-languages. It runs on a variety of compilers and operating systems, including Windows (with MinGW or Visual Studio, x86 and x86_64), iOS and Android. Javascript and WebAssembly versions are also available and are fully supported. Bindings for all common programming languages are available and well-supported.


Version 7.2.0 and newer of the PHP programming language includes the Sodium extension (referred to as ext/sodium) as a core cryptography library. Version 2 of the PHP extension in PECL is compatible with ext/sodium in PHP 7.2.


LimeSurvey uses the Sodium Compat library to bridge with different PHP versions. This library tentatively supports PHP 5.2.4 - 7.x (latest), but officially it only supports non-EOL'd versions of PHP.


Data encryption/decryption methods used in LimeSurvey are based on public-key signatures. Public and secret keys can be found in /application/config/security.php file. Keys are automatically generated on first usage of encryption feature.


{{Alert|title=Warning|text=Once data encryption is turned on, data in corresponding database columns would become unreadable without decrypting them first. You should always have a backup of your encryption keys in case they get deleted. Also, once encryption keys are set, you should never change them because it would make all existing data unusable.


Partial string search won't be possible for database columns with encrypted data, only exact match search.


Settings

There are three places in LimeSurvey where data encryption settings can be set: question attributes, participant attributes, and central participant database attributes.


Question attributes

Question attribute "Encrypted" is used to enable data encryption for corresponding responses. This attribute is turned off by default. Once survey is activated, it is not possible to change this attribute.



Participant attributes

Three core attributes (firstname, lastname, and email) are always shown in the survey participants table, encryption being turned on by default.

Each new participant attribute will have encryption turned off by default.

Encryption can be turned on or off at any moment.



Central participant database attribute management

Three core attributes (firstname, lastname and email) are always shown in the central participant database, encryption being turned on by default.

Each new participant attribute will have encryption turned off by default.

Encryption can be turned on or off at any moment.