PermaLinkAjax And Crypto: The Obstacles To Public Key Encryption In The Browser
12:29:21 PM

Two days ago, I demonstrated that Ajax is a viable architecture for practical browser-based secret key encryption. I have since gone on to investigate how I might use Ajax for a practical implementation of public key cryptography. Let me start by defining some attributes that I want to see in a practical solution.


  • Convenience Users should only have to enter one piece of secret information per session to access their private key.

  • Transparency Code is open to inspection so that users can be certain that software is not stealing private keys or transmitting plaintext data through hidden channels.

  • Location Independence Users should not have to physically carry their private key with them in order to use a browser on another computer.

  • Platform Independence Users should be able to use Windows, Mac, or Linux, with recent popular browsers.

  • Separation of Custody Private keys, even in encrypted form, are not stored with encrypted data, and vice versa.


Of these five attributes, the first two are very highly desirable. Ajax seems like a good architecture for achieving Convenience because it facilitates retrieving (via HTTP) and caching private key information. The key doesn't have to be re-loaded after each page transition because there are no page transitions. As for Transparency, the "j" in Ajax stands for Javascript, which makes it pretty clear that Ajax fits the bill.


The last attribute, separation of custody, is a good idea but strictly speaking it should not be necessary. Some people do store Notes Id files in the Domino Directory, or on open file shares, relying for security solely on the strength of the pass-phrase required for decrypting the private key. I don't recommend either practice, but that's really only because I don't tend to trust users to keep their pass-phrases secure. And as it turns out, Ajax does not provide any help in facilitating separation of custody. At least not in the way I had envisioned. So, this is an attribute that I think we're going to have to do without.


I should probably explain that last remark. The obvious way to implement Separation of Custody would be to store an X.509 certificate on one http server, and encrypted data on another. The server with the certificates and the server with the data would be managed completely separately. Furthermore, the certificates would be encrypted on the certifcate server, and authentication could be required in order to access it (although requiring authentication does work against Convenience since you would definitely not want the same passphrase used for authentication and for decrypting the certificate!). The problem here is that Ajax, or more specifically the xmlHTTPRequest object, will not allow you to access two servers within one application. In fact, it will only allow you to access the server that the Javascript code that calls it came from. That really doesn't surprise me. I had to test it, just in case, but if it had worked I probably would have been more worried than pleased. Javascript has always had safeguards against code accessing information from a server other than the one that the code was served from. You can't have code in one frame get data from another frame, for example, if the frames' content came from two different servers.


So, now I need to decide how to proceed on the crypto project. Which of the five attributes do I throw out? It's actually not 100% obvious that I have to throw out Separation of Custody. That could still be achieved, but at the expense of Location Independence, if I can find a way to store a the private key locally. Browsers already have a key store built in, actually, so I should rephrase that point. Storing a private key isn't the problem. Reading a local key store from Javascript is the problem. It could be done with either a downloaded signed Java applet, but that throws away Transparency (and unless things have improved in recent years on the "runs anywhere" front, it quite likely throws away Platform Indpendence as well), or some pre-installed ActiveX code (e.g, Windows Scripting Host includes functions that can access the file system) but that throws out Platform Independence.


Another option would be to have the user paste a private key into a field in the browser. This might not really be as bad as it sounds. Yes, Location Independence is gone, but in this case Platform Independence and Transparency could be preserved. Convenience could be maintained by entering the key once into page that contains a script that generates a GreaseMonkey script. The GreaseMonkey script would store the encrypted key, prompts you for the pass-phrase, decrypts the key, and enters it for you. So all you'd have to do is generate the script and add it to your GreaseMonkey configuration. What? You don't have GreaseMonkey? You're not running Firefox? Oops! There goes Platform Independence!


On the other hand, since I already know how to use BlowFish in Javascript for strong pass-phrase based encryption and decryption, losing Separation of Custody by storing the certificates in encrypted form on the same server as the data isn't really that bad an option.


Additional articles in this series...

    Is Ajax The Answer For Crypto In Browser-Based Applications
    Proof of Concept: Browser-Based Field Encryption With Blowfish Via Ajax
    An Improvement To The Classic Ajax Coding Pattern
    A Further Improvement To The Ajax Coding Pattern
    Why Ajax And Crypto Intrigue Me

This page has been accessed 501 times. .
Comments :v

1. Stephan H. Wissel05/15/2005 02:38:50 AM
Homepage: http://www.wissel.net


Hi Richard,
I really enjoy this little series. It opens up good possibilities. I was thinking about the separation of custody. what would happen if you write something like (markup brackets omitted)

script language="JavaScript"
var myPrivateKey = "";
/script
script language="JavaScript" src="URL_to_link_custody_domain" /script
script language="JavaScript" src="URL_to_mainDomain" /script

Would the custody Domain see "myPrivateKey" if it was loaded from maindomain?

In case that doesn't work: The script from the custody domain could alter the dom and put the key into a hidden design element. The Dom should be accessible from all scripts (?)

Of course security needs to be carefully considered since you could view the rendered source (there's a nice FF extension). But I guess that's only similar dangerous as using the JS debugger.
stw




2. Nathan T. Freeman05/16/2005 04:07:25 AM


"You can't have code in one frame get data from another frame, for example, if the frames' content came from two different servers."

Actually, you *can* as long as they're identified as being in same document domain. There's a header tag you need, and the DNS domains have to match.




3. Richard Schwartz05/16/2005 06:11:32 PM
Homepage: http://smokey.rhs.com/web/blog/PowerOfTheSchwartz.nsf


Interesting info, Nathan. I'll look into it. It could mean that if you can trust the DNS provider (possibly yet another party) to keep the data servers and certificate servers separate even though they appear to be in the same domain, then you can have effective separation of custody. Interesting.

-rich




4. vesoftware11/05/2013 11:01:04 PM
Homepage: http://vesoftware.blogspot.com/2013/10/itupokercom-agen-poker-online-indonesia.html


Agen Bola Promo 100% SBOBET IBCBET Casino Poker Tangkas Online
http://vesoftware.blogspot.com/2013/10/agen-bola-promo-100-sbobet-ibcbet.html
ITUPOKER.COM AGEN POKER ONLINE INDONESIA TERPERCAYA
http://vesoftware.blogspot.com/2013/10/itupokercom-agen-poker-online-indonesia.html
alfaonline.com : Toko belanja online murah, Promo heboh jual barang hanya Rp 1,-
http://vesoftware.blogspot.com/2013/10/alfaonlinecom-toko-belanja-online-murah.html
BELAJAR SEO
http://balapseo.blogspot.com/




5. cialis09/23/2016 05:57:02 AM
Homepage: http://www.erectilepharm11.com/wp/


http://www.erectilepharm11.com/wp/ , , and forget about it for a couple hours.




6. chenyingying10/17/2016 12:15:06 AM


http://www.seattleseahawksjerseys.us.com
http://www.canadagooseoutlet.eu.com
http://www.louisvuittonoutletdeals.us.com
http://www.uggbootsuk.com.co
http://www.raybansunglasses.me.uk
http://www.cheap--nfljerseys.us.com
http://www.bostoncelticsjerseys.com
http://www.giuseppe-zanotti.us
http://www.louisvuittonoutlet.net.co
http://www.jordan4.net
http://www.coachfactoryoutletclearances.us.com
http://www.tomsshoesuk.org.uk
http://www.louisvuittonparis.fr
http://www.pradahandbags.net
http://www.ralphlaurenoutletuk.in.net
http://www.cartierwatches.in.net
http://www.nike-rosherun.in.net
http://www.raybanoutlet.net.co
http://www.cincinnatibengalsjerseys.us.com
http://www.michaelkorsoutlet-onlinestore.us.com
http://www.adidasshoes.net
http://www.outlet-celine.com
http://www.uggsoutlet.de.com
http://www.jordan13.org
http://www.adidasoutletshoes.com
http://www.uggsbootsstore.com
http://www.canadagoosejackets.com.co
http://www.miamiheatjerseys.us.com
http://www.michaelkors--outlet.us.org
http://www.coachfactoryoutletonline.com.co
http://www.coachfactory-outlet.in.net
http://www.cheapoakleysunglasses.net.co
http://www.montblanc-pens.name
http://www.uggsoutlet.gr.com
http://www.michael-kors-handbags.us.org
http://www.clevelandcavaliersjerseys.us.com
http://www.ralphlauren-outlet.net.co
http://www.uggbootssale.de.com
http://www.pradaoutlet.net.co
http://timberland.officialfree.net
http://www.airmaxssale.com
http://www.canada-gooseoutlet.name
http://www.uggssale.com.co
http://www.louisvuitton.nom.co
http://www.nfljerseyswholesales.us
http://www.toryburch-outlet.in.net
http://www.louboutinshoessale.com
http://www.ugg-store.co.uk
http://www.nikeoutletstore.us.com
http://www.coachoutletstoreonlineclearances.com.co
http://www.gucci-outlet.name
http://www.ralphlaurenclearance.in.net
http://www.monclerjackets.com.co
http://www.raybanssunglasses.com.co
http://www.louisvuitton-discount.com
http://www.oakleyvaultoutlet.in.net
http://www.aididasyeezy.org.uk
http://www.cheapburberryoutlet.name
http://www.hermesbagusa.com
http://www.nike-airmaxpascher.fr
http://www.oklahomacitythunderjerseys.us.com
http://www.katespade-handbags.eu.com
http://www.adidas-yeezy.us.com
http://www.get-louisvuittonoutlet.com
http://www.uggcanada.in.net
http://www.newenglandpatriotsjerseys.us.com
http://www.christianlouboutinoutlet.com.co
http://www.coachoutletstoreonlineclearances.us.org
http://www.louisvuittonoutlet.de.com
http://www.burberry-outlet.com.co
http://www.coachfactoryoutletonlinesale.us.com
http://www.supra-shoes.net
http://www.raybansunglassess.com.co
http://www.ralphlaurenoutletonline.com.co
http://www.louis-vuittonoutlet.com.co
http://www.niketrainers.uk
http://www.authenticlouisvuittonhandbags.us.com
http://www.rayban-sunglasses.com.co
http://www.louis-vuittonoutlet.us.com
http://www.abercrombiekidsoutlet.name
http://www.true-religionoutlet.net.co
http://www.cheaprolexforsale.com
http://www.ralphlaurenuk.com.co
http://www.michaelhandbagsoutlet.us.com
http://www.michael-korsoutlets.eu.com
http://www.louisvuitton.me
http://www.kevindurantshoes.name
http://www.abercrombieoutletonline.cc
http://www.michaelkorsoutletforsale.com
http://www.jordansforsale.in.net
http://www.sunglassesoakley.com.co
http://www.coachcanadaoutlet.com.co
http://www.oakley-sunglasses.net.co
http://www.pittsburghsteelersjerseys.us.com
http://www.christianlouboutinsale.me.uk
http://www.adidassuperstar.name
http://ugg.uggsstore.eu
http://www.ralph-lauren.me.uk
http://www.lebronjames-shoes.net
http://www.canadagoose.de.com
chenyingying20161017




7. dongdong806/28/2017 11:43:03 PM


http://www.katespadeoutletstore.us.org
http://www.mamiundich.ch
http://www.adidas-nmdr1.us.com
http://www.michaelkorsonline-outlet.us.com
http://www.lecoqsportifshoes.us.com
http://www.coachfacyoryoutletonlinee.us.com
http://www.true-religion.me.uk
http://www.christianlouboutin.name
http://www.nikeairforce1.in.net
http://www.christianlouboutinoff.us
http://www.cheapoakleysunglasses.net.co
http://www.coachoutletonlineshop.us.com
http://www.softworx.it
http://www.louboutinparis.fr
http://www.wholesaleray-bansunglasses.us.com
http://www.converseshoesoutlet.us.com
http://www.fitflops.org
http://www.montblanc.com.co
http://www.adidas.in.net
http://www.energimamerking.no/canada-goose.html
http://www.oakleys-sunglassesoutlet.us.com
http://www.manchesterunitedjersey.co.uk
http://www.outletpolo-ralphlauren.us.com
http://www.grupolanda.es
http://www.energimamerking.no/ray-ban.html
http://www.recoilmag.com.au/christian-louboutin.html
http://www.burberrystore.us.com
http://www.hermesbeltoutlet.com
http://www.adidas-nmd.co.uk
http://www.archivigramsci.it
http://www.toryburchoutletsonline.us.com
http://www.uggbootsclearance.net.co
http://www.replica-watches.us.com
http://www.cheapchristianlouboutinshoes.us.com
http://www.the-northfaceoutlet.net.co
http://www.catboots.us.com
http://www.adidaszxflux.org.uk
http://www.sunglassesoakley.com.co
http://www.guccishoes.net.co
http://www.michaelkorsoutletstores.us.org
http://www.tory-burchoutletonline.us.com
http://www.tretronik.se
http://www.jaggabite.nl
http://www.noltingorgelgendringen.nl
http://www.christianlouboutinoutletusa.us.com
http://www.mlbjerseys.org
http://www.michael--kors--canada.ca
http://www.outletslongchamp.us.com
http://www.recoilmag.com.au/michael-kors.html
http://www.columbiasportswear.in.net
http://www.newbalance-shoes.us.com
http://www.mcmhandbags.us.org
http://www.adidassoccershoes.us
http://www.birkenstock.us.org
http://www.clarks-shoes.in.net
http://www.nikeoutlet-online.com
http://www.nylonic.co.uk
http://www.oakleysunglassescanada.ca
http://www.gosl.co.uk
http://www.recoilmag.com.au/rolex.html
http://www.coachoutletpurses.us.com
http://www.sproeiendekutjes.nl
http://www.nikeroshe.us.com
http://www.calvinklein.co.com
http://www.truereligion-jeans.com.co
http://www.nikefootballboots.org.uk
http://www.nfljerseyswholesalecheap.us.com
http://www.michaelkorsoutletsonlinesale.us.com
http://www.nikeroshe.org.uk
http://www.burberryonlineoutlet.net.co
http://www.nikefactory-outlet.us.com
http://www.nikehuarache.in.net
http://www.mbt.us.com
http://www.cheap-mlb-jerseys.us.com
http://www.rayban-sunglasses.com.co
http://www.rosherun.org
http://www.christianlouboutinsale.org.uk
http://www.mbt-shoes.in.net
http://www.maccosmeticsonline.us.com
http://www.cheapnhljersey.us.com
http://www.kobeshoes.us.com
http://www.adidastrainers.uk
http://www.adidassuperstar.name
http://www.coachwallets.us.com
http://www.nikesb.us
http://www.recoilmag.com.au/adidas-yeezy.html
http://www.coach-factoryonline.us.org
http://www.truereligion.net.co
http://www.katespadeoutletsale.us.com
http://www.nikehuarache.me.uk
http://www.energimamerking.no/ugg.html
http://www.yeezys350boostv2.us.com
http://www.poloralphlauren-outlet.com
20176.29wengdongdong




Enter Comments^


Email addresses provided are not made available on this site.





You can use UUB Code in your posts.

[b]bold[/b]  [i]italic[/i]  [u]underline[/u]  [s]strikethrough[/s]

URL's will be automatically converted to Links


:-x :cry: :laugh: :-( :cool: :huh: :-) :angry: :-D ;-) :-p :grin: :rolleyes: :-\ :emb: :lips: :-o
bold italic underline Strikethrough





Remember me    

Monthly Archive
Responses Elsewhere



About The Schwartz

rss.jpg


All opinions expressed here are my own, and do not represent positions of my employer.