pussinboots / angularjs-crypto Goto Github PK
View Code? Open in Web Editor NEWAngularJS module for decrytion/encryption of json in http requests/responses. heroku
AngularJS module for decrytion/encryption of json in http requests/responses. heroku
Hi,
I just want to let you know that the following links for dependencies aren't working.
http://crypto-js.googlecode.com/svn/tags/3.1.2/build/components/mode-ecb.js
http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/aes.js
I had to download via bower the crypto.js
The demo application https://angularjs-crypto.herokuapp.com was not working, because the cryptojs repository was shutdown. Download the cryptojs files and put it in this repository.
TypeError: Cannot assign to read only property '$queryParams' of Received from Server</h3>
Hello,
Can we add this repo to NPM public?
https://www.npmjs.com/search?q=angular-crypto
Hi
We have integrated the plugin in an angularjs/phonegap build hybrid mobile app. The interceptor takes care of the requests and correctly encrypts the parameters values but when we try to descrypt the data in the server it doesnt work out.
We have tried multiple options with no succes. For example, with
openssl_decrypt($data, 'aes-128-ecb', $jçkey, OPENSSL_RAW_DATA);
openssl_decrypt($data, 'aes-192-ecb', $jçkey, OPENSSL_RAW_DATA);
openssl_decrypt($data, 'aes-256-ecb', $jçkey, OPENSSL_RAW_DATA);
which uses the default padding, supposed to be Pkcs7, but we dont get any results.
What kind of settings do we need to use at backend to be able to process the encrypted data by the default settings of the plugin (AES, ECB and Pkcs7)?
Hello,
I am trying to encode and decode certain fields of a JSON Object.
I really really only want to use de encrypt/decrypt functions on their own but crypto seems to think for some reason that I want to do full query encryption, which results in messing with my queries and rewriting it, basically rendering my requests useless.
It turns the {params:{params}} into {params:query:{params}}.
Is this wanted behaviour? How can I turn it off?
When i installed using bower install angularjs-crypto, i got an archived version of 1.3.0 from last year. I had to specify bower install angularjs-crypto#master to get the most recent which has many of your significant fixes. can you please update your registry settings? thanks for working on this project
Hey,
I found that when I send a request which contains data that is supposed to be encrypted by using POST, in the console log it shows the raw data even though default parameter (_enc) was added at the end of specific field that is wanted to be encrypted and following code was added to the app.js of web application:
.run(['cfCryptoHttpInterceptor', function(cfCryptoHttpInterceptor) {
cfCryptoHttpInterceptor.base64Key = "16rdKQfqN3L4TY7YktgxBw==";
}]);
This happens in line number 20 in file angularjs-crypto.js. Here's an example:
Let's suppose that I want to send following object to the backend:
{id: 1, data_enc: "Hello"}
When you run your application and try to send that object, first is called angularjs-crypto.js library and it goes the code through until it comes to line 20, which is:
console.log("intercept request " + angular.toJson(data));
Here data is simply:
var data = request.data;
At this phase it will expose the raw data that is wanted to be sent with request and which must also be encrypted. Once you have run your application and open console log for example with Chrome, it shows following at angularjs-crypto line 20:
intercept request {"id": "1", "data_enc":"Hello"}
This is something that could be fixed.
This is compatible with angular 1.4 yes?
Hi,
I followed exact steps what you mentioned, and even then data when I see by pressing F12 of browser in xhr request, i can read data properly and no encryption? What I am missing? Have followed exactly what is been said.
Also, if I dont want to append _enc for every paramter I pass and receive, what should I do avoid it? I dont want it to a pre-requisite because that would make my code dirty.
My input JSON contains some null values. My aim is to use same JSON object for 3 forms, like a signup wizard. So obviously it contains null values till it reaches end. In this case, I am getting this error. Can you please help me with a solution?
TypeError: Cannot convert undefined or null to object
at Function.keys (native)
at crypt (http://10.100.3.122:9080/Nsure/angularmain/angularjs-crypto.js:95:23)
at crypt (http://10.100.3.122:9080/Nsure/angularmain/angularjs-crypto.js:100:13)
at crypt (http://10.100.3.122:9080/Nsure/angularmain/angularjs-crypto.js:100:13)
at crypt (http://10.100.3.122:9080/Nsure/angularmain/angularjs-crypto.js:100:13)
at crypt (http://10.100.3.122:9080/Nsure/angularmain/angularjs-crypto.js:100:13)
at encrypt (http://10.100.3.122:9080/Nsure/angularmain/angularjs-crypto.js:92:2)
at request (http://10.100.3.122:9080/Nsure/angularmain/angularjs-crypto.js:22:25)
at http://10.100.3.122:9080/Nsure/angularmain/angular.min.js:118:217
at n.a.$get.n.$eval (http://10.100.3.122:9080/Nsure/angularmain/angular.min.js:133:39) (anonymous function) @ angular.min.js:107b.$get @ angular.min.js:80(anonymous function) @ angular.min.js:118a.$get.n.$eval @ angular.min.js:133a.$get.n.$digest @ angular.min.js:130a.$get.n.$apply @ angular.min.js:133(anonymous function) @ angular.min.js:252c @ angular.min.js:35
I downloaded the latest angular-crypto.js files and it's dependencies. Using it with Angular v1.4.4.
Hi,
I don't know why but console always shows me this error:
Cannot read property 'encrypt' of undefined
Don't you have any idea what could have I done wrong?
ReferenceError: CryptoJS is not defined
What might be the issue?
I have included below lines:
<script src="bower_components/angularjs-crypto/public/js/lib/angularjs-crypto.js"></script><script src="bower_components/angularjs-crypto/public/js/lib/plugins/CryptoJSCipher.js"></script>
<!-- cryptojs aes files -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/components/aes.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/components/mode-ecb.js"></script>
Today I made a test where I send an stringified object to server. It seems that if you use
JSON.stringify({object})
the raw data will not be crypted even though in query crypt is set to true. For example if I pass
JSON.stringify({object})
to userData in following service call:
myFunction: function(userData){
return $http.post('/someURL', userData, {crypt: true}).success(function(data){
return data;
});
}
and you console log the sent data you see the actual raw data even if you have put _enc after fields you want to be encrypted. Either this could be fixed in the code or could be added in documentation.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.