Using PyCrypto with Spring Crypto/Spring Security Default Encoders

Spring Crypto Encryptor Details The Spring Crypto module is amazing. Secure defaults using standard interfaces really make it a pleasure to use, and with it being full tested and vetted, it also gives a develoepr the warm fuzzy feelings of nice Java security implentation. The standard interface is through the  org.springframework.security.crypto.encrypt.Encryptors class, defined (in version 3.2.0 here (the class API to which this blog post was written in July 2016). Spring Crypto uses AES256 encryption behind the scenes in its out of the box class setup; it's as easy as: In the above code snippet, the password  variable is a passcode, with the salt  variable used to create the AES key. It uses 256 bit encryption with the standard calls (depending on your JRE/Java Cryptography Extension (JCE) Setup, make sure to download the appropriate extension ). The default AESBytesEncryptor setup generates a 256 bit key (32 bytes) from a salted iteration done 1024 times. Another th

LA Public Library Overlays, Take 1 redux

I wanted to start a project that would try increase the use of the local LA County library system. To do so, I thought it would be awesome to get more people to stop buying books online and instead checkout books from their local library.

I still need to work out some kinks, but I created a github repo that will overlay any links (with ISBN-10 urls -- a small subset) to purchase a book from Amazon to re-direct to the LA County Library website search.

For instance, say there are links in the page like the following:

City of Dragons by Robin Hobb
O’Reilly’s Information Architecture for the Web (This was highlighted by the librarian when I was asking about API access :P)

Right now there is nothing special about the links. You can hover over them with your mouse to see that they point to Amazon.

To see the code in action

  1. [If using chrome: Drag this link onto the current tab][With Safari, drag it onto your Bookmarks bar, then click on the bookmarked link][Other browsers: TBD]: COLA Public Amazon Highlight

    Assuming that the github js link works, if you click on the link, and then re-hover over the previous links you will see API calls to the LA County website.

  2. Hover your cursor over the above Amazon links
You should see something like: Which link will direct you to the Los Angeles Colapublic Library page to reserve the book.
Login, place the book on hold and the library system will email you when the book is available to pickup at your local library.

To create a bookmarklet and get this functionality across the web, you can add the above javascript: link to your browser bookmarks. Bookmarks with javascript code are called bookmarklets then when you want the overlay functionality, simply select the bookmark(let)

Technically, there is nothing special in this iteration, but just a general idea.

Note:This blog was originally published on tumblr, but there where problems running 3rd party javascript to create in-page divs.

Comments

Popular posts from this blog

Spring Framework Sample Main Method

My Yahoo! Answers Science Post