Allow Multi-Dimensional array to support encryption data without changing array key

Created on 14 July 2023, 12 months ago
Updated 28 December 2023, 6 months ago

As of now this module supports the single dimensional array for the encryption .
Now we have to make this to support multi-dimensional array.

$service = \Drupal::service('asymmetric_encryption.encrypt_data');
$data = [
'Drupal' => "Drupal",
"Encrpt" => "encrypt values",
'decrypt' => "decryption values",
"check" => "checking the encryption works fine or not",
];
$data1 = $service->encryptElementsStringConvert($data, 'encrypt');
$dataDecrypt = $service->encryptElementsStringConvert($data1, 'decrypt');

print_r($data1);
print_r($dataDecrypt);die;

Output:
=====
Array
(
[Drupal] => HxWpEUinldkgmcJwXTHG5YmozkQ2VjqPEL0LBFx0oGDh2yvD3d1wscHiEUXNkKkWjbMhsadq
[Encrpt] => ksiUy-paEHLzjNc179ylIVVOeaG4AOsvE0nGG73SRD2VmWARe-LZBjrHeLrJOsN1Kk1z7YrhLwJ-4KuM0pc=
[decrypt] => nfkPq-cluAihAN-ZZ6bWuW71QpGcWFvJAQHumLSMsXISuroGtGqnk4KuKvfuGMvc_Mszsj6_j_HVJ8lUhN9oCFI=
[check] => pbAVeE006r8do7mecVOlr_oIg3QCeSWHLRCU59IDmS36qP5vQigwKV6qHKtKlOj3gtJJaoua6jEuNa0APkdcP5_Z6QNkayorO2sez7XefuLHHIR8b6wPQ3Q=
)
Array
(
[Drupal] => Drupal
[Encrpt] => encrypt values
[decrypt] => decryption values
[check] => checking the encryption works fine or not
)

Same like, it should support the multidimensional array without changing its corresponding key name of the array.

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇮🇳India PrabuEla chennai

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024