Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

encryption - Node.js and crypto library -


i'm having weird issues node's crypto library. wrote simple aes testing script:

var cipher = crypto.createcipher('aes-256-cbc','inmbuvp6z8') var text = "123|123123123123123"; cipher.update(text,'utf8','hex') var crypted = cipher.final('hex') var decipher = crypto.createdecipher('aes-256-cbc','inmbuvp6z8') decipher.update(crypted,'hex','utf8') var dec = decipher.final('utf8') 

when console.log(dec), it's null. reason if set test "123|123123", works. why "123|123123" work "123|123123123123123" doesn't?

you need store return cipher.update cipher.final sure have everything.

cipher.update "returns enciphered contents, , can called many times new data streamed":

http://nodejs.org/docs/v0.2.5/api.html#cipher-update-247

cipher.final "returns remaining enciphered contents".

i think append results each call this:

var crypto = require('crypto'); var cipher = crypto.createcipher('aes-256-cbc','inmbuvp6z8'); var text = "123|123123123123123"; var crypted = cipher.update(text,'utf8','hex'); crypted += cipher.final('hex'); var decipher = crypto.createdecipher('aes-256-cbc','inmbuvp6z8'); var dec = decipher.update(crypted,'hex','utf8'); dec += decipher.final('utf8'); 

i '12443a347e8e5b46caba9f7afc93d71287fbf11169e8556c6bb9c51760d5c585' crypted , '123|123123123123123' dec in above node v0.2.5


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -