What is the common encrypt/decrypt technique for CakePHP 3 and Angular 6?












0















I plan to encrypt data in CakePHP 3 and need to decrypt on Angular 6. Also, Viceversa.



Please share your thought if you have this experience.



Thanks in Advance!










share|improve this question


















  • 1





    I'm no Angular expert, but it runs on the client side, right? Meaning that the encryption key would need to be available to the client. How do you get that key there securely, and couldn't you instead use that process to get the decrypted thing there, skipping all the encryption complexity?

    – Greg Schmidt
    Nov 21 '18 at 15:52
















0















I plan to encrypt data in CakePHP 3 and need to decrypt on Angular 6. Also, Viceversa.



Please share your thought if you have this experience.



Thanks in Advance!










share|improve this question


















  • 1





    I'm no Angular expert, but it runs on the client side, right? Meaning that the encryption key would need to be available to the client. How do you get that key there securely, and couldn't you instead use that process to get the decrypted thing there, skipping all the encryption complexity?

    – Greg Schmidt
    Nov 21 '18 at 15:52














0












0








0


1






I plan to encrypt data in CakePHP 3 and need to decrypt on Angular 6. Also, Viceversa.



Please share your thought if you have this experience.



Thanks in Advance!










share|improve this question














I plan to encrypt data in CakePHP 3 and need to decrypt on Angular 6. Also, Viceversa.



Please share your thought if you have this experience.



Thanks in Advance!







angular cakephp






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 21 '18 at 7:18









raja singhraja singh

112




112








  • 1





    I'm no Angular expert, but it runs on the client side, right? Meaning that the encryption key would need to be available to the client. How do you get that key there securely, and couldn't you instead use that process to get the decrypted thing there, skipping all the encryption complexity?

    – Greg Schmidt
    Nov 21 '18 at 15:52














  • 1





    I'm no Angular expert, but it runs on the client side, right? Meaning that the encryption key would need to be available to the client. How do you get that key there securely, and couldn't you instead use that process to get the decrypted thing there, skipping all the encryption complexity?

    – Greg Schmidt
    Nov 21 '18 at 15:52








1




1





I'm no Angular expert, but it runs on the client side, right? Meaning that the encryption key would need to be available to the client. How do you get that key there securely, and couldn't you instead use that process to get the decrypted thing there, skipping all the encryption complexity?

– Greg Schmidt
Nov 21 '18 at 15:52





I'm no Angular expert, but it runs on the client side, right? Meaning that the encryption key would need to be available to the client. How do you get that key there securely, and couldn't you instead use that process to get the decrypted thing there, skipping all the encryption complexity?

– Greg Schmidt
Nov 21 '18 at 15:52












1 Answer
1






active

oldest

votes


















0














cakephp has Security Utility which provide encryption and decryption using AES-256 here is an example from cakephp doc



Encryption



//$value is the data 
//Assuming key is stored somewhere it can be re-used for
$key = 'wt1U5MACWJFTXGenFoZoiLwQGrLgdbHA';
$result = Security::encrypt($value, $key);


Decryption



$key = 'wt1U5MACWJFTXGenFoZoiLwQGrLgdbHA';

$cipher = $user->secrets;
$result = Security::decrypt($cipher, $key);


Encryption in Cakephp will use either openssl or mcrypt based on what is available on your system but mcrypt extension has been deprecated in PHP7.1



for more information please check
Encrypting and Decrypting Data using Cakephp



Javascript
If you are looking for how to use it with Javascript frameworks you should look for a library can decrypt AES and here is an example



https://github.com/JamesMGreene/node-aes256



var decrypted = aes256.decrypt(key, encrypted);


key is the one you use it in CakePHP and the encrypted is the encrypted data.
sorry im not AngularJS developer but you can use it on this way.






share|improve this answer


























  • How will it be decrypted in angular 6?

    – Sehdev
    Nov 21 '18 at 12:14











  • my answer updated

    – Mr.Geeker
    Nov 21 '18 at 20:22











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53407012%2fwhat-is-the-common-encrypt-decrypt-technique-for-cakephp-3-and-angular-6%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














cakephp has Security Utility which provide encryption and decryption using AES-256 here is an example from cakephp doc



Encryption



//$value is the data 
//Assuming key is stored somewhere it can be re-used for
$key = 'wt1U5MACWJFTXGenFoZoiLwQGrLgdbHA';
$result = Security::encrypt($value, $key);


Decryption



$key = 'wt1U5MACWJFTXGenFoZoiLwQGrLgdbHA';

$cipher = $user->secrets;
$result = Security::decrypt($cipher, $key);


Encryption in Cakephp will use either openssl or mcrypt based on what is available on your system but mcrypt extension has been deprecated in PHP7.1



for more information please check
Encrypting and Decrypting Data using Cakephp



Javascript
If you are looking for how to use it with Javascript frameworks you should look for a library can decrypt AES and here is an example



https://github.com/JamesMGreene/node-aes256



var decrypted = aes256.decrypt(key, encrypted);


key is the one you use it in CakePHP and the encrypted is the encrypted data.
sorry im not AngularJS developer but you can use it on this way.






share|improve this answer


























  • How will it be decrypted in angular 6?

    – Sehdev
    Nov 21 '18 at 12:14











  • my answer updated

    – Mr.Geeker
    Nov 21 '18 at 20:22
















0














cakephp has Security Utility which provide encryption and decryption using AES-256 here is an example from cakephp doc



Encryption



//$value is the data 
//Assuming key is stored somewhere it can be re-used for
$key = 'wt1U5MACWJFTXGenFoZoiLwQGrLgdbHA';
$result = Security::encrypt($value, $key);


Decryption



$key = 'wt1U5MACWJFTXGenFoZoiLwQGrLgdbHA';

$cipher = $user->secrets;
$result = Security::decrypt($cipher, $key);


Encryption in Cakephp will use either openssl or mcrypt based on what is available on your system but mcrypt extension has been deprecated in PHP7.1



for more information please check
Encrypting and Decrypting Data using Cakephp



Javascript
If you are looking for how to use it with Javascript frameworks you should look for a library can decrypt AES and here is an example



https://github.com/JamesMGreene/node-aes256



var decrypted = aes256.decrypt(key, encrypted);


key is the one you use it in CakePHP and the encrypted is the encrypted data.
sorry im not AngularJS developer but you can use it on this way.






share|improve this answer


























  • How will it be decrypted in angular 6?

    – Sehdev
    Nov 21 '18 at 12:14











  • my answer updated

    – Mr.Geeker
    Nov 21 '18 at 20:22














0












0








0







cakephp has Security Utility which provide encryption and decryption using AES-256 here is an example from cakephp doc



Encryption



//$value is the data 
//Assuming key is stored somewhere it can be re-used for
$key = 'wt1U5MACWJFTXGenFoZoiLwQGrLgdbHA';
$result = Security::encrypt($value, $key);


Decryption



$key = 'wt1U5MACWJFTXGenFoZoiLwQGrLgdbHA';

$cipher = $user->secrets;
$result = Security::decrypt($cipher, $key);


Encryption in Cakephp will use either openssl or mcrypt based on what is available on your system but mcrypt extension has been deprecated in PHP7.1



for more information please check
Encrypting and Decrypting Data using Cakephp



Javascript
If you are looking for how to use it with Javascript frameworks you should look for a library can decrypt AES and here is an example



https://github.com/JamesMGreene/node-aes256



var decrypted = aes256.decrypt(key, encrypted);


key is the one you use it in CakePHP and the encrypted is the encrypted data.
sorry im not AngularJS developer but you can use it on this way.






share|improve this answer















cakephp has Security Utility which provide encryption and decryption using AES-256 here is an example from cakephp doc



Encryption



//$value is the data 
//Assuming key is stored somewhere it can be re-used for
$key = 'wt1U5MACWJFTXGenFoZoiLwQGrLgdbHA';
$result = Security::encrypt($value, $key);


Decryption



$key = 'wt1U5MACWJFTXGenFoZoiLwQGrLgdbHA';

$cipher = $user->secrets;
$result = Security::decrypt($cipher, $key);


Encryption in Cakephp will use either openssl or mcrypt based on what is available on your system but mcrypt extension has been deprecated in PHP7.1



for more information please check
Encrypting and Decrypting Data using Cakephp



Javascript
If you are looking for how to use it with Javascript frameworks you should look for a library can decrypt AES and here is an example



https://github.com/JamesMGreene/node-aes256



var decrypted = aes256.decrypt(key, encrypted);


key is the one you use it in CakePHP and the encrypted is the encrypted data.
sorry im not AngularJS developer but you can use it on this way.







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 21 '18 at 20:22

























answered Nov 21 '18 at 11:45









Mr.GeekerMr.Geeker

198111




198111













  • How will it be decrypted in angular 6?

    – Sehdev
    Nov 21 '18 at 12:14











  • my answer updated

    – Mr.Geeker
    Nov 21 '18 at 20:22



















  • How will it be decrypted in angular 6?

    – Sehdev
    Nov 21 '18 at 12:14











  • my answer updated

    – Mr.Geeker
    Nov 21 '18 at 20:22

















How will it be decrypted in angular 6?

– Sehdev
Nov 21 '18 at 12:14





How will it be decrypted in angular 6?

– Sehdev
Nov 21 '18 at 12:14













my answer updated

– Mr.Geeker
Nov 21 '18 at 20:22





my answer updated

– Mr.Geeker
Nov 21 '18 at 20:22


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53407012%2fwhat-is-the-common-encrypt-decrypt-technique-for-cakephp-3-and-angular-6%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

SQL update select statement

WPF add header to Image with URL pettitions [duplicate]