5
0
Oplop is an algorithm to generate website specific passwords based on a master password and a keyword.
It is described here: http://code.google.com/p/oplop/wiki/HowItWorks
There's an online implementation here: https://oplop.appspot.com/
My attempt in Q is 204 200 167 165 139 characters ignoring whitespace:
{d:.Q.A,.Q.a,(n:"0123456789"),"-_";
b:d 2 sv'6 cut(,/)0b vs'(md5 x,y),2#0x00;
i:b in n;j:i?1b;k:(j _i)?0b;
8#$[0=0+/i;"1";8>j;();b j+(!)k],b}
EDIT: I achieved significant character savings by removing some redundant code from my Hex->Base64 conversion.
2012.03.07 - Cut out 2 more characters
2012.03.11 - Removed duplication and got accurate char count
2012.03.20 - Down to 141
Criteria
Candidate functions/implementations should take two strings as arguments and return an 8 character password as defined in the algorithm.
Judging
Code golf so shortest code takes the prize.
When will the judging be done? – Mark Thomas – 2012-03-21T12:22:21.770
I'll give it until the end of the month. 2012-04-01 00:00:00.000 – skeevey – 2012-03-21T13:16:18.420
1Imho, the problem description should be complete in that way, that an average programmer knows what to do. So you should name the steps to generate the code, while it is to the user to find out how to md5sum or to base64encode something. A website for further details is welcome, of course. Preparing a challenge on meta or in chat is - btw. - recommended. – user unknown – 2012-03-28T20:46:18.297