- Apr 24, 2015
-
- Apr 21, 2015
-
-
Dmitry Chestnykh authored
-
- Apr 20, 2015
-
-
Dmitry Chestnykh authored
-
Dmitry Chestnykh authored
This fixes panic due in PRNG "invalid argument to Intn" due to requesting random number with no range (0).
-
- Aug 09, 2014
-
-
Dmitry Chestnykh authored
-
- May 12, 2014
-
-
Dmitry Chestnykh authored
-
Dmitry Chestnykh authored
WARNING: introduces API incompatibility! This package generates captcha representations on-the-fly; for instance, if captcha solution was "123456", every call to NewImage() using this sequence of digits would generate a different random image containing "123456"; similarly, NewAudio() would generate a different audio pronouncing the same sequence: 1, 2, 3, 4, 5, 6. If a user, instead of storing generated outputs, exposes this functionality from their server, which is the default and recommended behaviour, an attacker could try loading the same image or audio over and over again in attempt to arrive at the most correct optical/voice recognition result. Instead of using a global non-deterministic pseudorandom number generator to distort images and audio, this commit introduces a deterministic PRNG for each image/audio. This PRNG uses a combination of a global secret key (generated once during initialization from a system CSPRNG) and captcha id and solution to produce pseudorandom numbers for each representation deterministically. Thus, calling NewImage() with the same captcha id and solution at different times will result in the same image (ditto for NewAudio). To make results unique not only for different solutions, but also for ids, these incompatible changes to public API have been introduced: NewImage and NewAudio changed from: func NewImage(digits []byte, width, height int) *Image func NewAudio(digits []byte, lang string) *Audio to: func NewImage(id string, digits []byte, width, height int) *Image func NewAudio(id string, digits []byte, lang string) *Audio That is, they now accept an additional captcha `id` argument. No other interfaces changed. Described changes also improved performance of generating captchas.
-
- Jan 10, 2014
-
-
Dmitry Chestnykh authored
-
- Dec 11, 2013
-
-
Dmitry Chestnykh authored
Fix typo.
-
Michael Gehring authored
-
- Dec 04, 2013
-
-
Dmitry Chestnykh authored
-
- Dec 03, 2013
-
-
Dmitry Chestnykh authored
Instead of writing directly via png.Encode, encode image into a buffer first, then write the whole buffer. ~~~ This commit is brought to you by: http://blog.oleganza.com Must-have source of knowledge about Bitcoin. ~~~ (Sponsor my commits! https://github.com/dchest/commit-ads)
-
- Oct 13, 2012
-
-
Dmitry Chestnykh authored
-
- Mar 11, 2012
-
-
Dmitry Chestnykh authored
-
Dmitry Chestnykh authored
-
Dmitry Chestnykh authored
-
Dmitry Chestnykh authored
-
- Feb 09, 2012
-
-
Dmitry Chestnykh authored
-
Dmitry Chestnykh authored
-
Dmitry Chestnykh authored
Go weekly 2012-02-07. Example is now capexample. To build helper tools: cd capexample && go install cd capgen && go install This will install tools capexample and cangen into $GOPATH/bin.
-
- Jan 16, 2012
-
-
Dmitry Chestnykh authored
-
Dmitry Chestnykh authored
-
Dmitry Chestnykh authored
-
- Oct 17, 2011
-
-
Dmitry Chestnykh authored
-
- Aug 21, 2011
-
-
Dmitry Chestnykh authored
-
- Jun 29, 2011
-
-
Dmitry Chestnykh authored
-
Dmitry Chestnykh authored
-
Dmitry Chestnykh authored
-
Dmitry Chestnykh authored
-
Dmitry Chestnykh authored
-
Dmitry Chestnykh authored
-
- Jun 06, 2011
-
-
Dmitry Chestnykh authored
-
- May 24, 2011
-
-
Dmitry Chestnykh authored
sounds.go doesn't have a copyright header, because the file is generated by a program. I don't want to make it output the copyright header, because users can generate sounds themselves, and the copyright status of such generated files can be different.
-
- May 12, 2011
-
-
Dmitry Chestnykh authored
-
Dmitry Chestnykh authored
-
Dmitry Chestnykh authored
-
- May 11, 2011
-
-
Dmitry Chestnykh authored
-
Dmitry Chestnykh authored
-
Dmitry Chestnykh authored
-
Dmitry Chestnykh authored
-