19 November 2000
London
Martinez Sylvain

martinez@encryptsolutions.com
bugs@bcrypt.com
sylvain.martinez@netcourrier.com
martinez@asi.fr

Company	: http://www.encryptsolutions.com
Bugs 	: http://www.bcrypt.com
personal : http://www.asi.fr/~martinez


          BUGS 

Big and Useful Great Security

DYNAMIC CRYPTOGRAPHY ALGORITHM


Rem : If you want to have more information about my progress in the different
      versions or about the different changes, read the LIB_HISTORY in the lib
      directory.

-> 19 November 2000: bugs 4.0.0

    This version is NOT compatible with the previous one. You HAVE to 
    recompile your applications with this new library.
    Please read the CHANGES and developper doc files for more information

    . New Library: .Splitted the library into 6 different .c files.
                   .The "complexity" options has been renamed to "round"
                   .The number of round and the bit swap modulo and the 
                    size of the block shuffle are now DYNAMIC.
                   .You can choose to enable or not this new dynamic option
                    as it might take more time to crypt a file.
                   .The bits operation now affects both bits
                   .There is now a buffer of keys (16 by default) in seed()
                    This creates a key dependancy !          
                    This buffer of key can also be set to be dynamic           
                   .New ASCII mode (v04) much more robust as it ignores
                    characters such as ">"
                   .bstream() now accepts KEYFILE !
                   .New function bssl() giving preset Security Level
                    (see HOWTO for more information).
                   .Replaced the code() and add() circular shift
                    (pretty useless) by using a LSFR function (long_rand())
                   .You can now specify a block crypt = 1 and it no
                    longer has to be as big as your keylength.
                    This affects the bcrypt and bchat aplications

    . Updated Applications: 
                   .bcrypt and bchat have now new options in order to use
                    the new library options (Dynamic and Buffer key).  
                    Also they now have the BSSL options !
                    and they can handle a block crypt (bc) = 1
                    when using power 0 or 1
                   .Corrected a bug in the bcrypt interactive mode affecting
                    the block crypt and block shuffle. 

    . Optimized compilation for Linux, using the -O3 with gcc

    . New Documenations.

-> 24 October 2000: bugs v3.5.3

    . New library: New ASCII MODE, much more efficient as it now uses
                   hexadecimal numbers.
                   Corrected minor bugs (compilation warnings)
    . New documentation

-> 03 October 2000: bugs v3.5.2

    . On some OS strncpy() does not add an End of Line character ('\0')
      this could cause the different applications to use wrong filenames
      if sent as a parameter. 
      This is now fixed for all the applications.

-> 02 October 2000: bugs v3.5.1

    . New library correcting a Windows compatibility problem in ASCII mode.
    . Also changed the ASCII mode FLAG, it now includes the Library version.
    . Updated the developer documentation

-> 01 October 2000: bugs v3.5.0

    . New Library and bcrypt application

    . Major bug correction with the crypt's power = 3. Sometimes what you were
      crypting with this power level couldn't be decrypted. This was because
      in some cases the algorithm could think it was using power = 4.

    . New feature you can now generate ASCII crypted file ! if you add the 
      -a flag to bcrypt (or choose the ASCII mode in the interactive menu)
      the cipher result wil be converted into large numbers. The output can
      then be copy and paste into your emails. To decrypt such a cipher text
      you just need to decrypt it with the -a flag.

    . New logo, smaller.

-> 27 September 2000: bugs v3.4.3

    . Major correction in the interactive mode for bcrypt and bchat applications
      as I was not validating correctly all the arguments prompted by these
      applications.

-> 26 September 2000: bugs v3.4.2
  
    . New Cryptography libray correcting minor bugs in bfile() and useless
      variable initialisation in bstream,bcrypt_test and bcrypt_add

    . There is now a BUGS official logo created by Florent Martinez
      This logo might change within few months.

-> 19 September 2000: bugs v3.4.1

    . New contest: BUGS CONTEST #2
      There is now much more information gicen away, 2 ciphers texts crypted
      the same key, the 2 original clear texts, found the key used to crypt
      those files ! 50 English Pound to win if you do...

-> 17 September 2000: bugs v3.4.0

    . New feature in bcrypt and bchat, there is now an interactive mode where
      the application will prompt you for each parameter.
      This is more secure than before because the options you
      specified can't be stored in an .history file nor visible if
      someone do a 'ps' at the same time than you crypt a file !
      just do: bcrypt -i
      or for bchat: bchat -i
    . All the applications can now specify a file to redirect the errors
      and warning generated by the library
    . Now the library update the progression variable to let you know
      how long you have to wait.
    . Changes in the library initialisation function
    . Minor Error check correction in the library

-> 02 August 2000: bugs v3.2.2

    . Corrected minor error in block and bunlock in the argcheck()
    . Corrected a problem in bcrypt, block and bunlock when a parameter
      was sent as a parameter.
    . Changed the default TYPE_INT from 'long' to 'int' for the library
    . Minor change in the testscript 

-> 01 August 2000: bugs v3.3.1

    . New contest information. I have decided to give away more information to
      make this contest more "real world" like. It should then now be easier
      for you to crack the algorithm.

-> 30 July 2000: bugs v3.3.0

    . Major change in the cryptography library: bstream() is now fully
      comptible with bfile(), cleaned up the code

    . 3 new applications: bmore, block and bunlock
      They allow you to consult a crypted file by just decrypting the file
      in memory. Really usefull if you just want to consult a crypted file
      but don't want to decrypt it.

-> 25 July 2000: bugs v3.2.1
    
    . Minor change in the testscript

    . Minor changes in the library: changed name of a variable, added some
      comments and extra output information.

-> 21 July 2000: bugs v3.2.0

    . Major changes giving full cryptography compatibility accross plateform.
      The algorithm can now handle the "ENDIAN" problem !

    . Changes in the way the key are generated, more efficient. AS A RESULT
      THIS NEW VERSION IS *NOT* COMPATIBLE with the previous one. I will make
      sure that all the next version will be compatible with this one though.

    . Minor correction in some of the applications.

    . Updated documentation.

-> 17 July 2000: bugs v3.1.1

    . Few corrections in the Makefile for BSD and Solaris, the make test 
      should now work also on Solaris and BSD

    . Minor correction in bcrypt.c for the display during the DEcrypting 
      process.

    . Minor correction in libcrypt regarding warning messages

-> 16 July 2000: bugs v3.1.0

    . Choice of the Random Number Generator (RNG)

    . New RNG, called ISAAC much more powerfull than the standard Unix function
      Possibility to specify your own seed or intialising it on /dev/random
      This cryptography algorithm is now using a string RNG.
      The changes have been made so it will be really easy to add a new RNG,
      When the Bruce Schneir's own algorithm YARROW will be available to Unix
      I add it to BUGS.

    . New option in bcrypt: you can your password as a parameter

    . New Makefile option, after doing a make all, you can do a make test
      to test if everything is working fine.

    . Minor changes to make the package compatible with OpenBSD and NetBSD

    . Minor changes in the library to make it Windows compatible

    . Changes in all the application regarding memory allocation

    . Updated documentation, CV


-> 20 May 2000: bugs v3.0.0

	. The library seems to be pretty stable, the final release can be
	  published on the internet.

	. Minor change in the library, added some extra parameter checks
	  in order to minimise errors.
	  

-> 09 May 2000: bugs v3.0.0 BETA 1

	. MAJOR changes:
	  This new algorithm is much more stronger than the old one. I have 
          been working on it for about 6 months now. The feedback I received 
	  from the internet has bee nreally helpful.

	. This is the first DYNAMICAL CRYPTOGRAPHY ALGORITHM

	. I have corrected all the problems highlighted by different
          people. The key generator is even stronger and offer the user
	  the option the select the complexity of the algorithm which
	  will be used. The higher the complexity the more operations
	  will be performed.

	. There are now 5 different power level, the seed function has been 
	  improved and there is now a shuffle function which will mix
	  data from the clear text. This mean that the cipher text is 
	  also function of the data it self that you are crypting.
	  You can also change the way the algorithm operates by changing
	  parameters. You can now tell the algorithm to do a seed and a shuffle
	  considering the file as one big block, or you can specify the 
	  length of the block you want the algorithm to work in. This changes
	  the way the algorithm works !
	  You can even specify the length of the block used for the shuffle 
	  function.

	. As I said earlier, this is a dynamical algorithm.
	  It works on any Unix machine.
	  Please note that even if it has been designed to work with 
	  any kind of integer (>= 16 bits) if you crypt something using
	  a 32 bits integer type you need to uncrypt it using a 32 bits
	  integer type. (see the technical helpfile to change the length
	  of the integer used in the algorithm)
	  This is a good feature, as you can make the algorithm architecture
	  dependant. By default the algorithm is using 32 bits int (long int).

	. You can also select the method you want the algorithm to use:
	  Harddisk or Memory
	  - Harddisk : The algorithm will directly access the file by accessing
		       blocks which will have the same length as the keylength 
		       used to crypt the file.
		       Pros: Low memory requirement
		       Cons: Could be slow if you want to crypt very big files
	  - Memory   : With this method the file will be loaded in memory
		       (or only part of the file if you are using custom
			crypt's block)
		       And the algorithm will simulate the harddisk access
		       but in fact access the memory.
		       Pros: Really quick, no or few disk access
		       Cons: If you crypt big files you need a lot of memory
			     But if you are going to crypt a 1Gig file
			     you would need a REALLY good/expensive computer
			     therefore 1Gig memory should not be a problem 
			     for you ;O)

	. There is now a new function which can be used to crypt buffered
	  stream of data.

	. This is the biggest, most complex and difficult project I have ever
	  done. It was worth it, even if my social life suffered from it ! :O)
	  This algorithm is so much stronger than the previous one.

-> 01 November 1999: bugs v2.0.1

    . Minor change in the library (library version is now correct: 2.0.0
      and not 1.8.0)
    . Minor change in the bcrypt version: removed some stupid dummy information
      only used for testing purposes.
    . I have fixed a problem in bcrypt.c with long filename including spaces
    . Minor change in the Makefile files: changed ' by \' when using echo
      
-> 25 August 1999 : bugs v2.0.0 

    . Change the Makefile files
    . New Crypt's library => v2.0.0 which corrects a minor bug in the
      blogin and bpass application and has been tested for weeks.
    . Corrected a minor compilation warning in all the application, I changed
      the pass_clear string from char to unsigned char.
    . MAJOR changes in the bcrypt application, corrected few bugs (especially
      while using a keyfile to crypt/uncrypt), you can now overwrite a file.
      I.e you don't need to specify a target file while crypting, in this case
      you will overwrite the clear file which becomes the cipher file.
      I have also changed the way I handle parameters, you can now put your 
      parameters in any order. 

Notes: This is now one year that I have done the previous version, v1.8.1.
       There are not a lot of changes in the library (Random function and
       minor bugs corrections) but there are a lot in the apps.
       The main application, bcrypt, should now be easier to use. Many bugs
       have been corrected. 
       I have decided to call this version to 2.0.0 as this package is now 
       REALLY different from the 1.5.x version, it has been tested for a year,
       everything seems to run fine. And this project is now a personal
       project. This version should be really stable !
       As usual any comments/ideas/help is welcome.
       Thank you.

-> 23 June 1998 : bugs v1.8.1

    . Since I am running the application test on the Internet I had a lot of
      feedback. Stephane Legrand gave me some information to make my application
      easier to compile on BSD OS.
      This version include only few modification for BSD in the file extra.c	
    . I upgraded some information in the documentation

-> 18 February 1998 : bugs v1.8.0

   . I made some BIG enhancement in my algorithm, in the swap bit part
     The algorithm is stronger and ... faster !
     I can crypt now 33 ko/s on a K6 233 with a fast hard drive 
     (200 ko for the file, and 128 bits for the key length)
     and 25 Ko/s on a P250 with a bad hard drive (my machine ...)
     By the way, all the donation are welcome ! :o)
   . I corrected some minor bugs
   . I finished the Windows 95/NT applciation
   . I added my CV in the application, as I nearly finished the University and
     I am going to find a job.
   . Realised an english documentation

Now, I am ready to put my applciation and library on the net everywhere it
is possible.
I just wait the end of the week, to make more tests.

Please, I would like a feedback, I need that for my Final report.
	 	
When I think about all the work I have done, I am quite happy that is nearly
finished !
(well, I said that 1 month ago ... ;)
But anyway there is a little difference between the old algorithm (2 ko /s)
and the new one (25 Ko /s).

-> 16 February 1998 : bugs v1.7.3
  
   . Now, I have a Windows 95 application using my crypt's library that
     Work ! 
   . I changed the way I used some parameters because on Windows95 with
     Delphi3 you can not send long string to a DLL !!
   . I made some modifications to several functions to make them work fine
     in a Windows95 DLL
   . I cleaned the source code of my library and my applications
   . I changed the log generation

-> 12 February 1998 : bugs v1.7.2

   . Fixed a big bug in the test_length function when I have the character
     '/0' in the string
   . Made some modifications in the log generation
     Now, I have a log on Windows95
   . Fixed minor bugs in the library 	

-> 07 February 1998 : bugs v1.7.1
   
   . I added a new global variable LIB_VERSION
   . I changed the write_hide function, I made it comptatible with Windows95
     DLL
   . I cleaned the library source code

-> 03 February 1998 : bugs v1.7.0

 The library now compile on Windows 95, I have now to use it with DELPHI 3

 I added many functions in my library :

bkey_generator : generate long password.
write_key_file : store the passwd generated previously in a file
read_key_file  : read the passwd from a file
write_hide     : Allow you to hide file (as cipher file !) in another
		 file.
		 The algorithm is quite simple, and you can just 
		 add your file a the end or the begining of another
		 file.
		 But it is enough to hide cipher file in image, a sound or a zip!
read_hide	: allow you to extract the data from a file
delete_passwd	: delete a passwd entry from a passwd archive file.

With these new functions, I have done other programs :
bkey 	: generate some long passwd, you can store them in a file.
	  the passwd generation can be initialised from a random
	  number or a 8 characters string length.
	  You can use these key as a passwd with bcrypt.
	  Indeed, I added a flag -f to bcrypt to enable this 
	  new feature.
bhide	: You can hide a cipher text (or any kind of data) at the end
          or at the begining of a file.
	  If you add your data at the end of an image file (BPM, JPG, ...)
	  the image seems the same, but contain some data !
	  You can also extract the data from a file.
bpassdel : You can delete a user from the password archive file.
	   You must have a user root in this file, indeed, only this 
         user can be allowed to erase other user.

 Some bugs have been fixed.
 I changed all the source code of the samples program.
 Now there is nothing in the main function.
 The source code is cleaner.
 
-> 20 January 1998 : bugs v1.6.3

I start to adapt my library on Windows 95 in a DLL, using a C++ compiler.

I fixed a big bug in the 2 crypt's file algorithm, when the filter I have to 
add is inferior to the length of the int type used in the algorithm.
(4 bytes if I use a long type.)

I changed the way I store my files (now I have some directories, it is 
not a rigth mess anymore ! ;)
I changed the makefile, it is now a bit more understandable.
I added a "extra.c", to separate my extra function from the library source, 
it is now easier to compile on an other OS.

I corrected some bugs in the probality algorithm.
I added a variable USER_LENGTH in the global structure.


-> 16 January 1998 : bugs v1.6.2

Everything seems to work fine, I tested my package on Linux, HpUX,
and Silicon Graphics (with cc).
I still have a problem to test it on SunOS but it seems it is because
of a bad installation of the C compiler !

MAJOR CHANGES:
I changed some part of my header and library to make it esier to compile
in Windows 95.
I have not global variables anymore but a global structure

MINOR CHANGES:
I changed my bcrypt_signal() function that intercept signal.
I changed the way I calculate the time to crypt.
I corrected the malloc bug of varinit variable in bpass.c and blogin.c


-> 08 January 1998: bugs v1.6.1

I corrected minor bugs with the crypt file function
I added a new power for the crypt file function :
               PROBABILITY Algorithm 
Now, You can choose between standard crypt file and probability
crypt file.

This new algorithm add the following enhancements :
- For one passwd and one clear text you can have several cipher text
  That increase the crypt's power, that's called "probability" because 
  if someone try to decrypt your cipher file, he is never sure that 
  what he has decrypted is the original cipher text.
  As I said, for one clear text, now there is several cipher text.
- To do that, I have to add some data at the end of the cipher text.
  the data's length I add is equal to the keylength used to crypt.

-> 07 january 1998: bugs v1.6.0
   
Great ... it is very late in the morning, but it is finished !
That is now 1 month that I work very hard of this new version.
(About 8 hours every day !!)
In fact, there is nothing from the old version now,
I reprogrammed everything, the algorithm is even not the same !

Why do I still call it BUGS ? hum good question :)

well, the base of the algorithm is the same than the one I have done 
2 years ago (v1.5). But as I said I had to reprogram EVERYTHING !

Now, I use register, I modified my algorithm (random generation number,
swap function, bit operations added, translation function, etc)
I avoid all the bugs (I hope !), I improved every part ...

Here are some of the new specifications of my new algorithm :
.Compact memory data storage
.Execution optimisation (I try to avoid all the operations that I can)
.Bilateral pseudo-random bits shift
.Pseudo-random bits operations
.Random key generator

The results : 
This program is much much much stronger than the other version !
Before, the crypt's rate was : 2 ko/s now, it is : 10 ko/s !!
(Tested on a P200 MMX, with a 100ko file)


-> 5 december 1997 : bugs v1.5.6
		 Well it's very late in the morning now ...
		 I worked a lot on my algorithm.
		 There is still a lot of point that I will have to modify
                 but nevermind, I start to translate in English.
                 I also improve the speed of my algorithm.
	
	Something new : THIS PROGRAM IS NOW MY BSC FINAL YEAR PROJECT

-> 19 January 1997 : bugs v1.5.5
		 - Fixed a stupid bug in the fonction bcrypt_read_passwd
                   Which disabled the multi user creation
                 - Fixed a more stupid bug, now the library can handle
                   the negative value of some ASCII character in 
                   decimal format. eg: on my Linux  = -23
		       because I didn't use unsigned type ...

-> July 1996 : bugs v1.5.4
		  Now, I compile all the programm with the flag '-Wall' ;=)
		  I corrected some few small errors.
			

-> July 1996 : bugs v1.5.3b 
		  I have made a modification in the blogin.c program 
                  Now I give a programme that I use ...
                  And that allow a simple User to manage several
                  users in his account, it is secure ! :)

-> April 1996 : bugs v1.5.3
		  I have the authorization to distribute the full version
		  of my program :)
                  Someone from the DST (French National Security Agency) gave me
                  the autorisation ...
		  So this is the full version !

-> May 1996 : bugs v1.5.2
	 	  I have fixed a bug in bpass.c and in login.c when you type 
                  your "old passwd"
 
-> February 1996: bugs v1.5.1
		  I just changed the part which crypt file.
		  that's just a little stronger...

-> January 1996: bugs v1.5 
	         This version has a new ALGO ... now I use bit shift,
		 that make my algorithm stronger.
                 But my algo is not as powerfull as it can be because if I want
		 to distribute it I have to make my algo less powerfull. :(
                 (French laws ...)

-> November 1995: Bcrypt v1.0
		  my first package, never distributed.
		  I was only using characters shift.
		  But there were several bugs with the prog that crypts file

-> October 1995: I just wrote my crypt's algorithm in C.
		 I tested it ... that was working ! :)
		 I called it : BUGS algorithm as it is my nickname on
		 the Internet (IRC, channel : #amigafr).
		 (note on the 18/02/1998 : well, I am not really often on IRC
		  at the moment, as it is banned in my University and that I
		  haven't a lot of free time ...)

-> September 1995: A friend shown me a program on AMIGA like 'MICROSOFT money'
		   I cracked the crypt algorithm in 5 minutes !

-> August 1995:  well, I was in hollydays, it was boring ...
		 For a week I thought about a good crypt's algorithm.
		 Just for fun ! :)

