Code Monkey home page Code Monkey logo

angularjs-crypto's People

Contributors

clange79 avatar pussinboots avatar stagegatemedia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

angularjs-crypto's Issues

encrypted data with default settings doesnt work out in php backend

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)?

Changif reqest parameters

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?

bower install

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

Intercepted request log shows user's entered information without encryption

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.

Not working even after following the steps.

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.

TypeError: Cannot convert undefined or null to object

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.

ReferenceError: CryptoJS is not defined

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>

image

Stringifying an object won't crypt the raw data

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.