• R/O
  • SSH
  • HTTPS

akdf: Commit


Commit MetaInfo

Revision371 (tree)
Time2019-05-06 04:27:58
Authorderekwildstar

Log Message

- Exclusão de pastas e arquivos obsoletos
- Exclusão de arquivos de ajuda do formato antigo
- Inclusão da pasta RES para arquivos de recurso diversos
- Inclusão da nova imagem do KRK

Change Summary

  • delete: trunk/DOC/MacroTemplates.xml
  • delete: trunk/DOC/PNG Components/Changelog.txt
  • delete: trunk/DOC/PNG Components/pngimage.chm
  • delete: trunk/DOC/PNG Components/PngComponents.html
  • delete: trunk/DOC/PNG Components/License.txt
  • delete: trunk/DOC/PNG Components
  • delete: trunk/DOC/Build-Help.bat
  • delete: trunk/DOC/DCPCrypt/osi-certified-120x100.png
  • delete: trunk/DOC/DCPCrypt/MIT_license.txt
  • delete: trunk/DOC/DCPCrypt/Index.html
  • delete: trunk/DOC/DCPCrypt/BlockCiphers.html
  • delete: trunk/DOC/DCPCrypt/Hashes.html
  • delete: trunk/DOC/DCPCrypt/Ciphers.html
  • delete: trunk/DOC/DCPCrypt
  • delete: trunk/DOC/chm/graphics/html_titlebkg.jpg
  • delete: trunk/DOC/chm/graphics
  • delete: trunk/DOC/chm/output/AKDF.chm
  • delete: trunk/DOC/chm/output
  • delete: trunk/DOC/chm
  • delete: trunk/DOC/DIUcl/DIUcl.chm
  • delete: trunk/DOC/DIUcl
  • delete: trunk/DOC/AKDF.dox-express
  • added: trunk/RES/IMG/krk.afphoto (diff)
  • added: trunk/RES/IMG
  • added: trunk/RES

Incremental Difference

--- trunk/DOC/MacroTemplates.xml (revision 370)
+++ trunk/DOC/MacroTemplates.xml (nonexistent)
@@ -1,27 +0,0 @@
1-<?xml version="1.0" encoding="UTF-8"?>
2-<Templates>
3-<Template Name="XDMH" Desc="XML Method Documentation">
4-<![CDATA[{$REGION '%UNIT%.%PROCNAME%.doc'}
5-/// <summary>|</summary>
6-/// <remarks>Descrição <c>codigo inline</c>
7-/// <para>Parágrafo</para>
8-/// <list type="bullet" | "number" | "table">
9-/// <listheader>
10-/// <term>term</term>
11-/// <description>description</description>
12-/// </listheader>
13-/// <item>
14-/// <term>term</term>
15-/// <description>description</description>
16-/// </item>
17-/// </list>
18-/// <note type="note" | "tip" | "warning" | "caution" | "security" | "security note" | "important" | "implement" | "caller" | "inherit" | "delphi" | "bcb">content</note></remarks>
19-/// <example><code lang="Delphi">Código-fonte exemplo</code></example>
20-/// <exception cref="ID">Descrição</exception>
21-/// %BEGINPARAMLIST%<param name="%PARAMNAME%">Descrição do parâmetro</param>
22-/// %ENDPARAMLIST%<returns>Descrição do retorno</returns>
23-/// <todo>Coisas a fazer</todo>
24-/// <seealso cref="ID">Referência Adicional</seealso>
25-{$ENDREGION}]]>
26-</Template>
27-</Templates>
\ No newline at end of file
--- trunk/DOC/PNG Components/License.txt (revision 370)
+++ trunk/DOC/PNG Components/License.txt (nonexistent)
@@ -1,74 +0,0 @@
1-END-USER LICENSE AGREEMENT
2-
3-All files included in this archive are Copyright (C) 2002-2005 - Martijn Saly.
4-Use and/or distribution of them requires acceptance of the following License
5-Agreement.
6-
7---------------------------------------------------------------------------------
8-
9-- "Author" herein refers to Martijn Saly (the creator of this package and
10- containing files and software).
11-- "Software" herein refers to all files bearing this notice, as well as any
12- other files and source code included with this package (typically extracted
13- from a .zip or .cab archive), and all content in them, regardless of whether
14- any modifications have been made.
15-- "Compile" herein refers to the automatic process of translating the Software's
16- source code into executable machine code by a compiler such as the one
17- included with Borland's Delphi or C++Builder.
18-
19-Except where otherwise noted, all of the documentation and Software included in
20-the this package is copyrighted by Martijn Saly (the Author).
21-
22-Copyright (C) 2002-2005 Martijn Saly. All rights reserved.
23-
24-
25-Use and distribution of the software is permitted provided that all of the
26-following terms are accepted. Terms 5 through 8 apply only to distributions
27-which include source code that one can Compile.
28-
29-1) The Software is provided "as-is," without any express or implied warranty. In
30- no event shall the Author be held liable for any damages arising from the use
31- or Compile of the Software.
32-
33-2) All redistributions of the Software's files must be in their original,
34- unmodified form. Distributions of modified versions of the files is not
35- permitted without express written permission of the Author.
36-
37-3) All redistributions of the Software's files must retain all copyright notices
38- and web site addresses that are currently in place, and must include this
39- list of conditions in its original, unmodified form.
40-
41-4) None of the Software's files may be redistributed for profit or as part of
42- another software package without express written permission of the Author.
43-
44-5) If applicable, you are permitted to Compile the Software, in orginal or
45- modified form, into any kind of application, including commercial or
46- shareware applications, or any application you are profiting from.
47-
48-6) If applicable, redistribution of any of the Software's files in object form
49- (including but not limited to .DCU and .OBJ formats) is strictly prohibited
50- without express written permission of the Author.
51-
52-7) If applicable, distribution of the Software in compiled package format
53- (the BPL file) is permitted, as long as the Software is distributed as part
54- of an application.
55-
56-8) If applicable, distribution of the Software in compiled package format
57- (the BPL file) is prohibed if the distribution does not specifically belong
58- to an application, written by the same author as the application was written
59- by.
60-
61-9) Full backward compatibility in future versions of the Software is not
62- guaranteed. In no event shall the Author be held liable for any inconvenience
63- or damages arising from lack of backward compatibility.
64-
65-If you do not agree to all of the above terms, you are not permitted to use or
66-Compile the Software in any way, and all copies of it must be deleted from your
67-system(s).
68-
69-----------------------------------------------------------------------------
70-
71-Martijn Saly
72-martijn@thany.org
73-http://www.thany.org/
\ No newline at end of file
--- trunk/DOC/PNG Components/Changelog.txt (revision 370)
+++ trunk/DOC/PNG Components/Changelog.txt (nonexistent)
@@ -1,45 +0,0 @@
1-PngComponents 1.1:
2-- Common: "adopted" the project from Martijn Saly
3-- Common: added D2009 support (mostly changed PngObject to PngImage)
4-- Common: removed compatibility with versions below Delphi 7
5-- Common: removed references to Thany.Inc (use RTLVersion instead)
6-- Common: cleaned up the code (mostly to use my formatting style)
7-- Editor: added "use file name" in PngImageListEditor (sets the name of the image to it's filename)
8-
9-PngComponents 1.0 RC3:
10-- Editor: Fixed "invalid header" exception when adding a PNG to the list.
11-- Editor: Everything should now look good on "large fonts" setting.
12-- PngBitBtn: Positioning and drawing of the glyph was sometimes a bit odd.
13-- PngBitBtn: Removed the need to draw an empty TBitmap glyph, prior to drawing the PNG glyph.
14-- PngSpeedButton: The image is now shifted down-right by 1 pixel, when the button is down but not pressed, to match the behavior of a normal SpeedButton.
15-- PngImageList: Fixed range check errors in PngToIcon32.
16-- PngImageList: Fixed possible AccessViolation in PngToIcon32.
17-- PngImageList: Fixed AccessViolation in AddImages.
18-- PngImageList: Fixed memory leak in CopyPngs.
19-- PngImageList: Added BeginUpdate and EndUpdate methods, to temporarily prevent the internal imagelist from being updated.
20-- PngImageList: The patched methods are more efficient, because they now manipulate the internal imagelist directly, rather than relying on CopyPngs.
21-- PngImageList: Added calls to Change in the patched methods.
22-
23-PngComponents 1.0 RC2:
24-- Editor: Fixed endless loop when repetitively removing the last image in a list of at least 3 (thanks to Aleksander Oven).
25-- Editor: Fixed possible out-of-bounds error when moving an image down using the Down button (thanks to Spiril).
26-- Editor: Now using Graphics.GetColorValues to retrieve available color identifiers (thanks to LJ and Ryan Mills).
27-- Editor: Rewritten ParseBackgroundColor and SelectBackgroundColor to use IdentToColor, StringToColor and ColorToIdent from Gaphics unit (thanks to LJ and Ryan Mills).
28-- Editor: It is now possible to set the background color to more than 1 selected image.
29-- Editor: Minor GUI fixes
30-- PngBitBtn: When Margin <> -1 and the button is focused, the image must be shifted 1 pixel, to match the behavior of a normal BitBtn.
31-- PngBitBtn: Fixed EPngHeaderNotPresent when assigning a nil to the PngImage property.
32-- PngBitBtn: PngImage property now behaves correctly when assigning an action. Note that the image will not be stored in the DFM if it came from a TActionList.ImageList (thanks to robvdl)
33-- PngSpeedButton: The same fixes that apply to PngBitBtn, applied to PngSpeedButton.
34-- PngImageList: Adding a default action to an imagelist no longer results in out of bounds errors (thanks to robvdl).
35-- PngImageList: 14 methods that couldn't be overridden are now patched (thanks to Vladimir Bochkarev). However, adding a default action to an imagelist still doesn't call the "new" Add method, but supposedly the legacy ImageList_Add() function, which cannot be patched.
36-- PngImageList: Fixed memory leak in CopyPngs (thanks to M. Youssfi).
37-- Common: Added Amount parameter to MakeImageBlended and MakeImageGrayscale.
38-- Common: Added function ConvertToPNG, which converts a TGraphic to a PNG object, if not already.
39-- Common: Added functions CreatePNG and CreatePNGMasked, which create a new PNG object based on a bitmap and a (color or bitmap) mask.
40-- Common: Added function CopyImageFromImageList, which effectively copies an image from a normal imagelist or a PngImageList into a PNG.
41-- Common: Added function SlicePNG for future use. This slices a large PNG object into smaller, equally-sized ones.
42-- Common: Added zlib version 1.2.2 to the PNG package (thanks to Vladimir Bochkarev).
43-
44-PngComponents 1.0 RC1:
45-- Initial public release
\ No newline at end of file
--- trunk/DOC/PNG Components/PngComponents.html (revision 370)
+++ trunk/DOC/PNG Components/PngComponents.html (nonexistent)
@@ -1,105 +0,0 @@
1-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml10.dtd">
2-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
3- <head>
4- <title>PngComponents</title>
5- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15"/>
6- <style type="text/css">
7- body,table {background-color: white; font: 9pt Verdana,Arial,sans-serif; line-height: 13pt; color: rgb(64,64,64); text-align: justify}
8- body {margin: 0; padding: 6pt 10%}
9- h1,h2 {font-family: Trebuchet MS,Verdana,Arial,sans-serif; letter-spacing: 1pt}
10- h1 {font-size: 14pt; text-align: center}
11- h2 {font-size: 12pt}
12- h2:before {content: "»"}
13- h2:after {content: "«"}
14- a {color: rgb(24,128,24)}
15- a:hover {background-color: rgb(224,255,236)}
16- a:hover > img {background-color: white}
17- hr {height: 1px; background-color: rgb(96,96,96); color: rgb(96,96,96); border: none; width: 98%}
18- .valid, .smalltitle, .subtitle {font-size: smaller}
19- .subtitle {line-height: 125%; margin-top: 2pt}
20- .smalltitle {text-align: center; margin-top: -1em}
21- .examples {text-align: center}
22- .examples div {margin-left: auto; margin-right: auto; border: solid 1px rgb(96,96,96); text-align: center; padding: 2pt 2pt 0 2pt; display: table}
23- .examples div div {border-width: 0; padding: 0; display: block}
24- strong {font-weight: bold}
25- strong.warning {color: red}
26- abbr {text-decoration: underline; cursor: help}
27- @media print {
28- h1 {margin-bottom: 2em}
29- .valid {display: none}
30- a {text-decoration: none; color: inherit}
31- a[href]:after {content: ' [' attr(href) ']'; font-style: italic}
32- a[rel="email"]:after {content: ' [' attr(title) ']'; font-style: italic}
33- abbr {text-decoration: none}
34- abbr span[title]:after {content: ' [' attr(title) ']'; font-style: italic}
35- }
36- </style>
37- </head>
38- <body>
39- <h1>PngComponents</h1>
40- <p class="smalltitle">This version: 1.0 RC2</p>
41-
42- <h2>What is PngComponents?</h2>
43- <p>PngComponents is a set of components that allows you to include in your application real PNG files. PNG files on their own do not generate an enourmous advantage, but their support for an alpha-channel does indeed have quite a charm to it. The PngComponents library supports alpha-channels to their full extend, using a modified version of the excellent <a href="http://pngdelphi.sourceforge.net" title="Visit the homepage for the pngdelphi delphi at SourceForge" target="_blank">pngdelphi</a> library.</p>
44- <div class="examples">
45- <div>
46- <img src="../example images/Computer_32.png" alt="Windows XP computer icon"/>
47- <img src="../example images/RemoteComputer_32.png" alt="Windows XP remote computer icon"/>
48- <img src="../example images/FolderClosed_32.png" alt="Windows XP closed folder icon"/>
49- <img src="../example images/FolderOpen_32.png" alt="Windows XP open folder icon"/>
50- <br/>
51- <div class="subtitle">Examples of PNG images with alpha-channels.<br/>Note that these don't work correctly in Internet Explorer (all versions up to 6).</div>
52- </div>
53- </div>
54- <p>PngComponents' main and most important component is the PngImageList. This is a descendant of the normal TImageList, with in addition full support for PNGs with an alpha-channel. This will enable you to keep using most components that take advantage of imagelists, while actually feeding them icons with alphablending capabilities. Two other very nice components are the PngSpeedButton and the PngBitBtn. These two buttons do not have a Glyph anymore, but in stead, they accept a PNG file to be assigned directly to the button, without the need for an imagelist (just like the normal SpeedButton and BitBtn). And since the PNG glyphs are drawn in realtime, there's no more hassling with WM_DISPLAYCHANGE when the user changes the clBtnFace color in his display settings...</p>
55- <p>Two other components included in the library are the PngImageCollection, which is simply a collection of PNG images. Nothing more, nothing less. The last one is the PngCheckListBox. This one accepts PNG glyphs for the check states. Beside that, it's a completely normal CheckListBox.</p>
56- <p>I've also added a "fix" for Alex Desinov's awesome addon for Jordan Russell's <a href="http://www.jrsoftware.org" title="Visit Jordan Russell's homepage, featuring Toolbar2000, among others" target="_blank">Toolbar2000</a>, called <a href="http://www.g32.org" title="Visit Alex Desinov's homepage, featuring the Toolbar2000 addon, TBX, among others" target="_blank">TBX</a>. This fix is a replacement for the OfficeXP theme. Just replace TBXOfficeXPTheme in your uses clause with PngTBXOfficeXPTheme and that's it! Beautiful alphablended icons become possible in the OfficeXP theme as well.</p>
57-
58- <h2>Why should I use PngComponents?</h2>
59- <p>The PngComponents library offers a major leap forward in creating nice GUI's in designtime. Not only does it speed up the implementation of alphablended icons in your application, it eases the way you can use them throughout your software. No longer do you need to put them in a resource file manually and then manually drawing them on a temporary bitmap and assigning that to somewhere. Adding beautiful alphablended icons to your interface is but a few clicks away.</p>
60-
61- <h1>Usage</h1>
62-
63- <h2>Common</h2>
64- <p>The PngBitBtn and PngSpeedButton both have two extra properties, PngImage and PngOptions. PngImage substitutes the Glyph property with a PNG image, so only PNG files can be loaded into it. PngOptions determines what a disabled glyph looks like. You can choose from a combination of having it blended and having it grayscaled.</p>
65- <p>The PngImageList and PngImageCollection share the same editor. This editor can be used to load PNG files into the respective component. When editing a PngImageList, the editor will only allow PNG files that have the correct dimensions. When editing a PngImageCollection, any PNG can be added. Note that in either case, it doesn't matter if you mix color depths or other properties.</p>
66- <p><em>Note:</em> the beta versions of PngComponents required that you use a PngImageCollection and assign it to the PngImageList.PngImages property. That is no longer the case, i.o.w. the components have been separated completely.</p>
67-
68- <h2>The editor</h2>
69- <p>As said before, the PngImageList and PngImageCollection share an editor that allows to modify the contents of the respective component:</p>
70- <ul>
71- <li>The <strong>Add</strong> button will ask for a PNG image. After that, you may set its name and background color. Note that you can select multiple files and add them all at once.</li>
72- <li>The <strong>Delete</strong> button deletes the currently selected image(s), after having asked for confirmation.</li>
73- <li>The <strong>Replace</strong> button only works when a single image is selected. It will ask for a PNG file and will replace the actual image.</li>
74- <li>The <strong>Clear</strong> button empties the list, after having asked for confirmation.</li>
75- <li>The <strong>Up</strong> button moves the currently selected images one position up, if possible.</li>
76- <li>The <strong>Down</strong> button moves the currently selected images one position down, if possible.</li>
77- <li>You can also <strong>drag</strong> images in the listbox. They'll be moved as you drag them, in realtime.</li>
78- <li>Remember that you can select <strong>multiple</strong> images, for your convenience.</li>
79- </ul>
80- <p>The editor will show up when you doubleclick the PngImageList or PngImageCollection component. You may also select <em>Edit images...</em> from its context menu, or doubleclick the PngImageList.PngImages or PngImageCollection.Items property.</p>
81-
82- <h2>The ImageList</h2>
83- <p>The ImageList has some features and issues you should probably know about:</p>
84- <ul>
85- <li>The images you add to the list are internally pumped into the "real" imagelist, so that native "API" windows controls, like listviews and treeviews, can take advantage of it. Even though PngImageList tries to make the best out of it, Windows 2000 and earlier simply do not support an alpha channel in an icon and may therefor display it incorrectly. This also applies on Windows XP and later, if you forget to add a manifest to your application. Note that themes support is not required for this to work, just a manifest is enough (themes may even be unavailable).</li>
86- <li>The editor will not crop or resize images that do not conform the dimensions of the imagelist. Unfortunately, this is extremely hard when working with PNG images, due to limitations in the pngdelphi library.</li>
87- <li>Components that do not natively support the PngImageList will not draw disabled images correctly. Those components usually have their own algorithm to generate disabled images, which will not work with the modern-style flashy colorful alpha-blended PNG images. You may want to include another imagelist with the same images, but with the <em>EnabledImages</em> property set to False.</li>
88- </ul>
89-
90- <h2>The OfficeXP fix</h2>
91- <p>A small introduction: Jordan Russell's <a href="http://www.jrsoftware.org" title="Visit Jordan Russell's homepage, featuring Toolbar2000, among others" target="_blank">Toolbar2000</a> is a set of components for creating Office 2000-style toolbars and such. Alex Desinov's <a href="http://www.g32.org" title="Visit Alex Desinov's homepage, featuring the Toolbar2000 addon, TBX, among others" target="_blank">TBX</a> is an add-on package that adds even more functionality as well as theming. This allows for themes like "OfficeXP", "Office2003" and more.</p>
92- <p>The OfficeXP theme comes standard with TBX and it's the one getting in major trouble when using in combination with PngComponents. The alpha-blended area's look ugly, images may show dark borders, and other kinds of artefacts may show up.</p>
93- <p>The fix I've included is as simple as it is effective; it's a unit called PngTBXOfficeXPTheme. If you replace TBXOfficeXPTheme in your uses clauses with PngTBXOfficeXPTheme, you should be all set! You will not have the fancy looks in designtime, but in runtime your application will look better than ever.</p>
94- <p><strong class="warning">Warning!</strong> If you still need TBXOfficeXPTheme included in your uses clause, then make sure PngTBXOfficeXPTheme gets initialized <strong>after</strong> TBXOfficeXPTheme, or it will not work as expected.</p>
95-
96- <h1>Miscellaneous</h1>
97- <h2>Feedback</h2>
98- <p>I love to get feedback! You can either go to the <abbr><span title="Server: news.jrsoftware.org - Group: jrsoftware.toolbar2000.thirdparty - no username or password is required">newsgroup</span></abbr> or <a href="mailto:martijn@thany.org?subject=PngComponents" rel="email" title="martijn@thany.org">send me an e-mail</a> if you have a specific question.</p>
99- <h2>Legal</h2>
100- <p>See the License.txt file included in the archive. If the file is not there, the ZIP file is not a genuine PngComponents download!</p>
101-
102- <hr/>
103- <table class="valid" cellspacing="0" cellpadding="0" border="0" width="100%"><tr><td style="width: 100%">This page is best viewed with <a href="http://www.opera.com/" target="_blank">Opera</a> or <a href="http://www.mozilla.org/products/firefox/" target="_blank">Firefox</a>. This page is also optmized for <a href="javascript:window.print();">printing</a>.</td><td><a href="http://jigsaw.w3.org/css-validator" title="Valid CSS 2.0!" target="_blank"><img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS 2.0!" height="31" width="88"/></a>&nbsp;<a href="http://validator.w3.org/" title="Valid XHTML 1.0 Transitional!" target="_blank"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Transitional!" height="31" width="88"/></a></td></tr></table>
104- </body>
105-</html>
\ No newline at end of file
--- trunk/DOC/Build-Help.bat (revision 370)
+++ trunk/DOC/Build-Help.bat (nonexistent)
@@ -1 +0,0 @@
1-"C:\Program Files (x86)\Doc-O-Matic 7 Express\domexpress.exe" -w2 AKDF.dox-express
\ No newline at end of file
--- trunk/DOC/DCPCrypt/MIT_license.txt (revision 370)
+++ trunk/DOC/DCPCrypt/MIT_license.txt (nonexistent)
@@ -1,21 +0,0 @@
1-The MIT License
2-
3-Copyright (c) <year> <copyright holders>
4-
5-Permission is hereby granted, free of charge, to any person obtaining a
6-copy of this software and associated documentation files (the "Software"),
7-to deal in the Software without restriction, including without limitation
8-the rights to use, copy, modify, merge, publish, distribute, sublicense,
9-and/or sell copies of the Software, and to permit persons to whom the
10-Software is furnished to do so, subject to the following conditions:
11-
12-The above copyright notice and this permission notice shall be included in
13-all copies or substantial portions of the Software.
14-
15-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18-THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21-DEALINGS IN THE SOFTWARE.
--- trunk/DOC/DCPCrypt/Index.html (revision 370)
+++ trunk/DOC/DCPCrypt/Index.html (nonexistent)
@@ -1,270 +0,0 @@
1-<html>
2- <head>
3- <title>DCPcrypt v2: Users Guide - Index</title>
4- </head>
5- <body>
6- <p align="center"><font size="+2"><b>DCPcrypt Cryptographic Component Library v2 Beta 3</b></font><br>
7- <font size="+1">Copyright &copy; 1999-2002 David Barton<br>
8- <a href="http://www.cityinthesky.co.uk/">http://www.cityinthesky.co.uk/</a><br>
9- <a href="mailto:crypto@cityinthesky.co.uk">crypto@cityinthesky.co.uk</a></font>
10- <p><font size="+2">Introduction</font>
11- <p>DCPcrypt is a collection of cryptographic components for the Borland Delphi(tm), C++ Builder(tm) and Kylix(tm) programming languages. The supported versions are Delphi 4, 5, 6 and 7, C++ Builder (3?), 4, 5, 6 and Kylix 1 (untested) and 2.
12- <p>The idea behind DCPcrypt is that it should be possible to "drop in" any algorithm implementation to replace another with minimum or no code changes. To aid in this goal all cryptographic components are descended from one of several base classes, TDCP_cipher for encryption algorithms and TDCP_hash for message digest algorithms.
13- <p>
14- <table>
15- <tr>
16- <td valign="center"><a href="http://www.opensource.org/docs/definition.php"><img src="osi-certified-120x100.png" border="0"></a></td>
17- <td valign="center">
18- <p>DCPcrypt is open source software (released under the <a href="MIT_license.txt">MIT license</a>) and as such there is no charge for inclusion in other software. However, I am currently a student and if you are making money from my software I would really appreciate a donation of some sort, whether financial or a license for the software you develop (<em>or if anyone wants to sponsor a Mathematical Modelling (Masters) student for their final year...</em>). Please note THIS IS NOT COMPULSORY IN ANY WAY. See <a href="http://www.cityinthesky.co.uk/cryptography.html">http://www.cityinthesky.co.uk/cryptography.html</a> for details on donations.
19- <p>This software is OSI Certified Open Source Software. OSI Certified is a certification mark of the <a href="http://www.opensource.org/">Open Source Initiative</a>.
20- <p>If you maintain a website then a link to my page at <a href="http://www.cityinthesky.co.uk/">http://www.cityinthesky.co.uk/</a> would be great!
21- </td>
22- </tr>
23- </table>
24- <p>&nbsp;
25- <p><font size="+2">What's New</font>
26- <p>Changes since DCPcrypt v2 Beta 2:
27- <ul>
28- <li>Corrected C++ Builder compilation problem.
29- </ul>
30- <p>Changes since DCPcrypt v2 Beta 1:
31- <ul>
32- <li>Renamed source code files for hashes and ciphers to DCPxxx.pas
33- <li>Change the format of Cipher.InitStr so that the hash algorithm used to generate the key is explicitly specified. In order to get the same functionality as before, use TDCP_sha1. e.g. Cipher.InitStr('Hello World',TDCP_sha1);
34- <li>Block ciphers are now inherited from an intermediate component that implements the block size specific chaining mode encryption routines.
35- <li>Remove the internal component registration, it was more hassle than it was worth. If there is a demand for this to be put back then I might...
36- <li>Added the full range of operation modes for Haval. By changing the defines at the top of DCPhaval.pas you can specify the number of passes and the output hash size.
37- <li>Added the Tiger hash algorithm (192bit digest).
38- <li>Changed the name of the file containing TDCP_ripemd160 for consistency to DCPripemd160 from DCPrmd160.
39- <li>GOST no longer appears on the component palette pending verifying what the actual standard is (the code is still included however).
40- <li>Added the RipeMD-128 hash algorithm (128bit digest).
41- <li>Added the Serpent block cipher (AES finalist).
42- <li>Added the SHA-256,384,512 hash algorithms (256, 384, 512bit digest respectively).
43- <li>Added CTR chaining mode to all block ciphers.
44- </ul>
45- <p>&nbsp;
46- <p><font size="+2">Installation</font>
47- <p>
48- <table>
49- <tr>
50- <td width="120">Delphi</td>
51- <td>Open the appropriate package, DCPdelphiX.dpk where X is your version of Delphi (either 4, 5 or 6). Then press the install button.</td>
52- </tr>
53- <tr>
54- <td width="120">C++ Builder</td>
55- <td>Create a new design time package and add all the .pas files from the DCPcrypt2.zip archive including all those in the Ciphers and Hashes subdirectories. Then press the install button.</td>
56- </tr>
57- <tr>
58- <td width="120">Kylix</td>
59- <td>Open the DCPkylix.dpk package and then press the install button (note: Kylix 1 users may need to create a new package as with C++ Builder as this is a Kylix 2 package).</td>
60- </tr>
61- <table>
62- <p>You may need to add the directory containing DCPcrypt (and the Ciphers and Hashes subdirectories) to your library search path (found under Environment Options).
63- <p>Once installed you will find two extra pages of components on your component palette, namely DCPciphers and DCPhashes. You can now place these components onto the form of your application to start using the algorithms.
64- <p>&nbsp;
65- <p><font size="+2">Usage</font>
66- <p>Please note that an appreciation of the basic principles of encryption/decryption and key management is needed to ensure the correct usage of the ciphers implemented within this package. A good introduction on this subject is provided by Bruce Schneier's "Applied Cryptography" (ISBN: 0-471-11709-9) also see the NIST publication SP800-38A for information on the block cipher chaining modes.
67- <ul>
68- <li><a href="Ciphers.html">Ciphers</a> - the basic building block of DCPcrypt, the TDCP_cipher component.
69- <li><a href="BlockCiphers.html">Block Ciphers</a> - the base of all block ciphers, the TDCP_blockcipher component.
70- <li><a href="Hashes.html">Hashes</a> - the base of all hash algorithms, the TDCP_hash component.
71- </ul>
72- <p>DCPcrypt v2 contains the following ciphers and hash algorithms:
73- <p>
74- <table bgcolor="#FFFFCC" align="center">
75- <tr>
76- <td colspan="4" align="center"><font size="+1"><b>Ciphers</b></font></td>
77- </tr>
78- <tr>
79- <td><b>Name</b></td>
80- <td><b>Patents</b></td>
81- <td><b>Block Size</b></td>
82- <td><b>Max Key Size*</b></td>
83- </tr>
84- <tr>
85- <td>Blowfish</td>
86- <td>None</td>
87- <td>64 bits</td>
88- <td>448 bits</td>
89- </tr>
90- <tr>
91- <td>Cast-128</td>
92- <td>None</td>
93- <td>64 bits</td>
94- <td>128 bits</td>
95- </tr>
96- <tr>
97- <td>Cast-256</td>
98- <td>Patented?</td>
99- <td>128 bits</td>
100- <td>256 bits</td>
101- </tr>
102- <tr>
103- <td>DES</td>
104- <td>None</td>
105- <td>64 bits**</td>
106- <td>64 bits</td>
107- </tr>
108- <tr>
109- <td>3DES</td>
110- <td>None</td>
111- <td>64 bits</td>
112- <td>192 bits</td>
113- </tr>
114- <tr>
115- <td>Ice</td>
116- <td>None?</td>
117- <td>64 bits</td>
118- <td>64 bits</td>
119- </tr>
120- <tr>
121- <td>Thin Ice</td>
122- <td>None?</td>
123- <td>64 bits</td>
124- <td>64 bits</td>
125- </tr>
126- <tr>
127- <td>Ice 2</td>
128- <td>None?</td>
129- <td>64 bits</td>
130- <td>128 bits</td>
131- </tr>
132- <tr>
133- <td>IDEA</td>
134- <td>Free for non-commercial use</td>
135- <td>64 bits</td>
136- <td>128 bits</td>
137- </tr>
138- <tr>
139- <td>MARS</td>
140- <td>Patented?</td>
141- <td>128 bits</td>
142- <td>1248 bits</td>
143- </tr>
144- <tr>
145- <td>Misty1</td>
146- <td>Free for non-commercial use</td>
147- <td>64 bits</td>
148- <td>128 bits</td>
149- </tr>
150- <tr>
151- <td>RC2</td>
152- <td>None</td>
153- <td>64 bits</td>
154- <td>1024 bits</td>
155- </tr>
156- <tr>
157- <td>RC4</td>
158- <td>None</td>
159- <td>N/A</td>
160- <td>2048 bits</td>
161- </tr>
162- <tr>
163- <td>RC5</td>
164- <td>Patented</td>
165- <td>64 bits</td>
166- <td>2048 bits</td>
167- </tr>
168- <tr>
169- <td>RC6</td>
170- <td>Patented</td>
171- <td>128 bits</td>
172- <td>2048 bits</td>
173- </tr>
174- <tr>
175- <td>Rijndael (AES)</td>
176- <td>None</td>
177- <td>128 bits</td>
178- <td>256 bits</td>
179- </tr>
180- <tr>
181- <td>Serpent</td>
182- <td>None</td>
183- <td>128 bits</td>
184- <td>256 bits</td>
185- </tr>
186- <tr>
187- <td>TEA</td>
188- <td>None</td>
189- <td>64 bits</td>
190- <td>128 bits</td>
191- </tr>
192- <tr>
193- <td>Twofish</td>
194- <td>None</td>
195- <td>128 bits</td>
196- <td>256 bits</td>
197- </tr>
198- </table>
199- <p>* although the quoted maximum key size may extremely large it doen't mean that the algorithm is secure to the same level.<br>
200- ** a 64bit key is used for DES then every 8th bit is discarded (parity) so the effective size is 56 bits.
201- <p>
202- <table bgcolor="#FFFFCC" align="center">
203- <tr>
204- <td colspan="3" align="center"><font size="+1"><b>Hash Algorithms</b><font></td>
205- </tr>
206- <tr>
207- <td><b>Name</b></td>
208- <td><b>Patents</b></td>
209- <td><b>Digest Size</b></td>
210- </tr>
211- <tr>
212- <td>Haval</td>
213- <td>None</td>
214- <td>128, 160, 192, 224, 256 bits*</td>
215- </tr>
216- <tr>
217- <td>MD4</td>
218- <td>None</td>
219- <td>128 bits</td>
220- </tr>
221- <tr>
222- <td>MD5</td>
223- <td>None</td>
224- <td>128 bits</td>
225- </tr>
226- <tr>
227- <td>RipeMD-128</td>
228- <td>None</td>
229- <td>128 bits</td>
230- </tr>
231- <tr>
232- <td>RipeMD-160</td>
233- <td>None</td>
234- <td>160 bits</td>
235- </tr>
236- <tr>
237- <td>SHA-1</td>
238- <td>None</td>
239- <td>160 bits</td>
240- </tr>
241- <tr>
242- <td>SHA-256</td>
243- <td>None</td>
244- <td>256 bits</td>
245- </tr>
246- <tr>
247- <td>SHA-384</td>
248- <td>None</td>
249- <td>384 bits</td>
250- </tr>
251- <tr>
252- <td>SHA-512</td>
253- <td>None</td>
254- <td>512 bits</td>
255- </tr>
256- <tr>
257- <td>Tiger</td>
258- <td>None</td>
259- <td>192 bits</td>
260- </tr>
261- </table>
262- <p>* The different digest sizes of Haval can be accessed by uncommenting the $defines at the start of DCPhaval.pas.
263- <p>&nbsp;
264- <p><font size="+2">Contact</font>
265- <p>I appreciate knowing what DCPcrypt is being used for and also if you have any queries or bug reports please email me at <a href="mailto:crypto@cityinthesky.co.uk">crypto@cityinthesky.co.uk</a>.
266- <p>&nbsp;
267- <p><em>DCPcrypt is copyrighted &copy; 1999-2003 David Barton.<br>
268- All trademarks are property of their respective owners.</em>
269- </body>
270-</html>
--- trunk/DOC/DCPCrypt/BlockCiphers.html (revision 370)
+++ trunk/DOC/DCPCrypt/BlockCiphers.html (nonexistent)
@@ -1,84 +0,0 @@
1-<html>
2- <head>
3- <title>DCPcrypt v2: Users Guide - Block Ciphers</title>
4- </head>
5- <body>
6- <p align="center"><font size="+2"><b>DCPcrypt Cryptographic Component Library v2</b></font><br>
7- <font size="+1">Copyright &copy; 1999-2002 David Barton<br>
8- <a href="http://www.cityinthesky.co.uk/">http://www.cityinthesky.co.uk/</a><br>
9- <a href="mailto:crypto@cityinthesky.co.uk">crypto@cityinthesky.co.uk</a></font>
10- <p><font size="+2">Block Ciphers - TDCP_blockcipher</font>
11- <p>All block ciphers are inherited from the TDCP_blockcipher component via either the TDCP_blockcipher64 and TDCP_blockcipher128 components (the latter implement the block size specific code).
12- <p>The TDCP_blockcipher component extends the TDCP_cipher component to provide chaining mode functions. Functions available are:
13- <pre>
14- property <a href="Ciphers.html#Initialized">Initialized</a>: boolean;
15- property <a href="Ciphers.html#Id">Id</a>: integer;
16- property <a href="Ciphers.html#Algorithm">Algorithm</a>: string;
17- property <a href="Ciphers.html#MaxKeySize">MaxKeySize</a>: integer;
18- property <a href="#BlockSize">BlockSize</a>: integer;
19- property <a href="#CipherMode">CipherMode</a>: TDCP_ciphermode;
20-
21- class function <a href="Ciphers.html#SelfTest">SelfTest</a>: boolean;
22-
23- procedure <a href="#SetIV">SetIV</a>(const Value);
24- procedure <a href="#GetIV">GetIV</a>(var Value);
25-
26- procedure <a href="Ciphers.html#Init">Init</a>(const Key; Size: longword; InitVector: pointer);
27- procedure <a href="Ciphers.html#InitStr">InitStr</a>(const Key: string; HashType: TDCP_hashclass);
28- procedure <a href="Ciphers.html#Burn">Burn</a>;
29- procedure <a href="Ciphers.html#Reset">Reset</a>;
30- procedure <a href="Ciphers.html#Encrypt">Encrypt</a>(const Indata; var Outdata; Size: longword);
31- procedure <a href="Ciphers.html#Decrypt">Decrypt</a>(const Indata; var Outdata; Size: longword);
32- function <a href="Ciphers.html#EncryptStream">EncryptStream</a>(InStream, OutStream: TStream; Size: longword): longword;
33- function <a href="Ciphers.html#DecryptStream">DecryptStream</a>(InStream, OutStream: TStream; Size: longword): longword;
34- function <a href="Ciphers.html#EncryptString">EncryptString</a>(const Str: string): string;
35- function <a href="Ciphers.html#DecryptString">DecryptString</a>(const Str: string): string;
36- procedure <a href="#EncryptECB">EncryptECB</a>(const Indata; var Outdata);
37- procedure <a href="#DecryptECB">DecryptECB</a>(const Indata; var Outdata);
38- procedure <a href="#EncryptCBC">EncryptCBC</a>(const Indata; var Outdata; Size: longword);
39- procedure <a href="#DecryptCBC">DecryptCBC</a>(const Indata; var Outdata; Size: longword);
40- procedure <a href="#EncryptCFB8bit">EncryptCFB8bit</a>(const Indata; var Outdata; Size: longword);
41- procedure <a href="#DecryptCFB8bit">DecryptCFB8bit</a>(const Indata; var Outdata; Size: longword);
42- procedure <a href="#EncryptCFBblock">EncryptCFBblock</a>(const Indata; var Outdata; Size: longword);
43- procedure <a href="#DecryptCFBblock">DecryptCFBblock</a>(const Indata; var Outdata; Size: longword);
44- procedure <a href="#EncryptOFB">EncryptOFB</a>(const Indata; var Outdata; Size: longword);
45- procedure <a href="#DecryptOFB">DecryptOFB</a>(const Indata; var Outdata; Size: longword);
46- procedure <a href="#EncryptCTR">EncryptCTR</a>(const Indata; var Outdata; Size: longword);
47- procedure <a href="#DecryptCTR">DecryptCTR</a>(const Indata; var Outdata; Size: longword);
48- </pre>
49- <hr>
50- <p><font size="+2">Function descriptions</font>
51- <p><font size="+1"><a name="BlockSize">property BlockSize: integer;</a></font>
52- <p>This contains the block size of the cipher in BITS.
53- <p><font size="+1"><a name="CipherMode">property CipherMode: TDCP_ciphermode;</a></font>
54- <p>This is the current chaining mode used when <a href="Ciphers.html#Encrypt">Encrypt</a> is called. The available modes are:
55- <ul>
56- <li>cmCBC - Cipher block chaining.
57- <li>cmCFB8bit - 8bit cipher feedback.
58- <li>cmCFBblock - Cipher feedback (using the block size of the algorithm).
59- <li>cmOFB - Output feedback.
60- <li>cmCTR - Counter.
61- </ul>
62- <p>Each chaining mode has it's own pro's and cons. See any good book on cryptography or the NIST publication SP800-38A for details on each.
63- <p><font size="+1"><a name="SetIV">procedure SetIV(const Value);</a></font>
64- <p>Use this procedure to set the current chaining mode information to Value. This variable should be the same size as the block size. When <a href="Ciphers.html#Reset">Reset</a> is called subsequent to this, the chaining information will be set back to Value.
65- <p><font size="+1"><a name="GetIV">procedure GetIV(var Value);</a></font>
66- <p>This returns in Value the current chaining mode information, to get the initial chaining mode information you need to call <a href="Ciphers.html#Reset">Reset</a> before calling GetIV. The variable passed in Value must be at least the same size as the block size otherwise you will get a buffer overflow.
67- <p><font size="+1"><a name="EncryptCBC">procedure EncryptCBC(const Indata; var Outdata; Size: longword);</a></font><br>
68- <font size="+1"><a name="DecryptCBC">procedure DecryptCBC(const Indata; var Outdata; Size: longword);</a></font><br>
69- <font size="+1"><a name="EncryptCFB8bit">procedure EncryptCFB8bit(const Indata; var Outdata; Size: longword);</a></font><br>
70- <font size="+1"><a name="DecryptCFB8bit">procedure DecryptCFB8bit(const Indata; var Outdata; Size: longword);</a></font><br>
71- <font size="+1"><a name="EncryptCFBblock">procedure EncryptCFBblock(const Indata; var Outdata; Size: longword);</a></font><br>
72- <font size="+1"><a name="DecryptCFBblock">procedure DecryptCFBblock(const Indata; var Outdata; Size: longword);</a></font><br>
73- <font size="+1"><a name="EncryptOFB">procedure EncryptOFB(const Indata; var Outdata; Size: longword);</a></font><br>
74- <font size="+1"><a name="DecryptOFB">procedure DecryptOFB(const Indata; var Outdata; Size: longword);</a></font><br>
75- <font size="+1"><a name="EncryptCTR">procedure EncryptCTR(const Indata; var Outdata; Size: longword);</a></font><br>
76- <font size="+1"><a name="DecryptCTR">procedure DecryptCTR(const Indata; var Outdata; Size: longword);</a></font>
77- <p>These procedures encrypt/decrypt Size bytes of data from Indata and places the result in Outdata. These all employ chaining mode methods of encryption/decryption and so may need to be used inconjunction with <a href="Ciphers.html#Reset">Reset</a>. The CBC method uses short block encryption as specified in Bruce Schneier's "Applied Cryptography" for data blocks that are not multiples of the block size.
78- <p>&nbsp;
79- <p><a href="Index.html">Index</a>, <a href="Ciphers.html">Ciphers</a>, <a href="Hashes.html">Hashes</a>
80- <p>&nbsp;
81- <p><em>DCPcrypt is copyrighted &copy; 1999-2002 David Barton.<br>
82- All trademarks are property of their respective owners.</em>
83- </body>
84-</html>
--- trunk/DOC/DCPCrypt/Hashes.html (revision 370)
+++ trunk/DOC/DCPCrypt/Hashes.html (nonexistent)
@@ -1,107 +0,0 @@
1-<html>
2- <head>
3- <title>DCPcrypt v2: Users Guide - Hash Algorithms</title>
4- </head>
5- <body>
6- <p align="center"><font size="+2"><b>DCPcrypt Cryptographic Component Library v2</b></font><br>
7- <font size="+1">Copyright &copy; 1999-2002 David Barton<br>
8- <a href="http://www.cityinthesky.co.uk/">http://www.cityinthesky.co.uk/</a><br>
9- <a href="mailto:crypto@cityinthesky.co.uk">crypto@cityinthesky.co.uk</a></font>
10- <p><font size="+2">Hash Algorithms - TDCP_hash</font>
11- <p>All hashes are derived from the TDCP_hash component. It provides a range of functions to allow the hashing of virtually every type of data.
12- <p>Functions available are:
13- <pre>
14- property <a href="#Initialized">Initialized</a>: boolean;
15- property <a href="#Id">Id: integer</a>;
16- property <a href="#Algorithm">Algorithm</a>: string;
17- property <a href="#HashSize">HashSize</a>: integer;
18-
19- class function <a href="#SelfTest">SelfTest</a>: boolean;
20-
21- procedure <a href="#Init">Init</a>;
22- procedure <a href="#Final">Final</a>(var Digest);
23- procedure <a href="#Burn">Burn</a>;
24-
25- procedure <a href="#Update">Update</a>(const Buffer; Size: longword);
26- procedure <a href="#UpdateStream">UpdateStream</a>(Stream: TStream; Size: longword);
27- procedure <a href="#UpdateStr">UpdateStr</a>(const Str: string);
28- </pre>
29- <p>Example usage:
30- <ul>
31- <li><a href="#Example1">Example 1</a> - File hashing.
32- </ul>
33- <hr>
34- <p><font size="+1"><a name="Initialized">property Initialized: boolean;</a></font>
35- <p>This is set to true after <a href="#Init">Init</a> has been called.
36- <p><font size="+1"><a name="Id">property Id: integer;</a></font>
37- <p>Every algorithm I implement gets given a unique ID number so that if I use several different algorithms within a program I can determine which one was used. This is a purely arbitrary numbering system.
38- <p><font size="+1"><a name="Algorithm">property Algorithm: string;</a></font>
39- <p>This is the name of the algorithm implemented in the component.
40- <p><font size="+1"><a name="HashSize">property HashSize: integer;</a></font>
41- <p>This is the size of the output of the hash algorithm in BITS.
42- <p><font size="+1"><a name="SelfTest">class function SelfTest: boolean;</a></font>
43- <p>In order to test whether the implementations have all been compiled correctly you can call the SelfTest function. This compares the results of several hash operations with known results for the algorithms (so called test vectors). If all the tests are passed then true is returned. If ANY of the tests are failed then false is returned. You may want to run this function for all the components when you first install the DCPcrypt package and again if you modify any of the source files, you don't need to run this everytime your program is run. Note: this only performs a selection of tests, it is not exhaustive.
44- <p><font size="+1"><a name="Init">procedure Init;</a></font>
45- <p>Call this procedure to initialize the hash algorithm, this must be called before using the <a href="#Update">Update</a> procedure.
46- <p><font size="+1"><a name="Final">procedure Final(var Digest);</a></font>
47- <p>This procedure returns the final message digest (hash) in Digest. This variable must be the same size as the hash size. This procedure also calls <a href="#Burn">Burn</a> to clear any stored information.
48- <p><font size="+1"><a name="Burn">procedure Burn;</a></font>
49- <p>Call this procedure if you want to abort the hashing operation (normally <a href="#Final">Final</a> is used). This clears all information stored within the hash. Before the hash can be used again <a href="#Init">Init</a> must be called.
50- <p><font size="+1"><a name="Update">procedure Update(const Buffer; Size: longword);</a></font>
51- <p>This procedure hashes Size bytes of Buffer. To get the hash result call <a href="#Final">Final</a>.
52- <p>Update example:
53- <pre>
54- <b>procedure</b> HashBuffer(<b>const</b> Buffer; Size: <b>longint</b>; <b>var</b> Output);
55- <b>var</b>
56- Hash: TDCP_ripemd160;
57- <b>begin</b>
58- Hash:= TDCP_ripemd160.Create(<b>nil</b>);
59- Hash.Init;
60- Hash.Update(Buffer,Size);
61- Hash.Final(Output);
62- Hash.Free;
63- <b>end</b>;
64- </pre>
65- <p><font size="+1"><a name="UpdateStream">procedure UpdateStream(Stream: TStream; Size: longword);</a></font>
66- <p>This procedure hashes Size bytes from Stream. To get the hash result call <a href="#Final">Final</a>.
67- <p><font size="+1"><a name="UpdateStr">procedure UpdateStr(const Str: string);</a></font>
68- <p>This procedure hashes the string Str. To get the hash result call <a href="#Final">Final</a>.
69- <hr>
70- <p><font size="+2"><a name="Example1">Example 1 - File hashing</a></font>
71- <p>This example shows how you can hash the contents of a file
72- <pre>
73- <b>procedure</b> TForm1.Button1Click(Sender: TObject);
74- <b>var</b>
75- Hash: TDCP_ripemd160;
76- Digest: <b>array</b>[0..19] <b>of</b> <b>byte</b>; <em>// RipeMD-160 produces a 160bit digest (20bytes)</em>
77- Source: TFileStream;
78- i: <b>integer</b>;
79- s: string;
80- <b>begin</b>
81- Source:= <b>nil</b>;
82- <b>try</b>
83- Source:= TFileStream.Create(Edit1.Text,fmOpenRead); <em>// open the file specified by Edit1</em>
84- <b>except</b>
85- MessageDlg('Unable to open file',mtError,[mbOK],0);
86- <b>end</b>;
87- <b>if</b> Source <> <b>nil then</b>
88- <b>begin</b>
89- Hash:= TDCP_ripemd160.Create(Self); <em>// create the hash</em>
90- Hash.Init; <em>// initialize it</em>
91- Hash.UpdateStream(Source,Source.Size); <em>// hash the stream contents</em>
92- Hash.Final(Digest); <em>// produce the digest</em>
93- Source.Free;
94- s:= '';
95- <b>for</b> i:= 0 <b>to</b> 19 <b>do</b>
96- s:= s + IntToHex(Digest[i],2);
97- Edit2.Text:= s; <em>// display the digest</em>
98- <b>end</b>;
99- <b>end</b>;
100- </pre>
101- <p>&nbsp;
102- <p><a href="Index.html">Index</a>, <a href="Ciphers.html">Ciphers</a>, <a href="BlockCiphers.html">Block Ciphers</a>
103- <p>&nbsp;
104- <p><em>DCPcrypt is copyrighted &copy; 1999-2002 David Barton.<br>
105- All trademarks are property of their respective owners.</em>
106- </body>
107-</html>
--- trunk/DOC/DCPCrypt/Ciphers.html (revision 370)
+++ trunk/DOC/DCPCrypt/Ciphers.html (nonexistent)
@@ -1,273 +0,0 @@
1-<html>
2- <head>
3- <title>DCPcrypt v2: Users Guide - Ciphers</title>
4- </head>
5- <body>
6- <p align="center"><font size="+2"><b>DCPcrypt Cryptographic Component Library v2</b></font><br>
7- <font size="+1">Copyright &copy; 1999-2002 David Barton<br>
8- <a href="http://www.cityinthesky.co.uk/">http://www.cityinthesky.co.uk/</a><br>
9- <a href="mailto:crypto@cityinthesky.co.uk">crypto@cityinthesky.co.uk</a></font>
10- <p><font size="+2">Ciphers - TDCP_cipher</font>
11- <p>All ciphers are inherited from the TDCP_cipher component either directly for stream ciphers (such as RC4) or via the TDCP_blockcipher component.
12- <p>The TDCP_cipher component implements key initialisation features and the basic encryption/decryption interface. Functions available are:
13- <pre>
14- property <a href="#Initialized">Initialized</a>: boolean;
15- property <a href="#Id">Id</a>: integer;
16- property <a href="#Algorithm">Algorithm</a>: string;
17- property <a href="#MaxKeySize">MaxKeySize</a>: integer;
18-
19- class function <a href="#SelfTest">SelfTest</a>: boolean;
20-
21- procedure <a href="#Init">Init</a>(const Key; Size: longword; InitVector: pointer);
22- procedure <a href="#InitStr">InitStr</a>(const Key: string; HashType: TDCP_hashclass);
23- procedure <a href="#Burn">Burn</a>;
24- procedure <a href="#Reset">Reset</a>;
25- procedure <a href="#Encrypt">Encrypt</a>(const Indata; var Outdata; Size: longword);
26- procedure <a href="#Decrypt">Decrypt</a>(const Indata; var Outdata; Size: longword);
27- function <a href="#EncryptStream">EncryptStream</a>(InStream, OutStream: TStream; Size: longword): longword;
28- function <a href="#DecryptStream">DecryptStream</a>(InStream, OutStream: TStream; Size: longword): longword;
29- function <a href="#EncryptString">EncryptString</a>(const Str: string): string;
30- function <a href="#DecryptString">DecryptString</a>(const Str: string): string;
31- </pre>
32- <p>Example usage:
33- <ul>
34- <li><a href="#Example1">Example 1</a> - String encryption.
35- <li><a href="#Example2">Example 2</a> - File encryption.
36- <li><a href="#Example3">Example 3</a> - General encryption.
37- </ul>
38- <hr>
39- <p><font size="+2">Function descriptions</font>
40- <p><font size="+1"><a name="Initialized">property Initialized: boolean;</a></font>
41- <p>Once key initialization has been performed this property is set to true, otherwise it is set to false. Calling <a href="#Burn">Burn</a> will immediately set this to false.
42- <p><font size="+1"><a name="Id">property Id: integer;</a></font>
43- <p>Every algorithm I implement gets given a unique ID number so that if I use several different algorithms within a program I can determine which one was used. This is a purely arbitrary numbering system.
44- <p><font size="+1"><a name="Algorithm">property Algorithm: string;</a></font>
45- <p>This contains the name of the algorithm implemented within the component.
46- <p><font size="+1"><a name="MaxKeySize">property MaxKeySize: integer;</a></font>
47- <p>This is the maximum size of key you can pass to the cipher (in bits!).
48- <p><font size="+1"><a name="SelfTest">class function SelfTest: boolean;</a></font>
49- <p>In order to test whether the implementations have all been compiled correctly you can call the SelfTest function. This compares the results of several encryption/decryption operations with known results for the algorithms (so called test vectors). If all the tests are passed then true is returned. If ANY of the tests are failed then false is returned. You may want to run this function for all the components when you first install the DCPcrypt package and again if you modify any of the source files, you don't need to run this everytime your program is run. Note: this only performs a selection of tests, it is not exhaustive.
50- <p><font size="+1"><a name="Init">procedure Init(const Key; Size: longword; InitVector: pointer);</a></font>
51- <p>This procedure initializes the cipher with the keying material supplied in Key. The Size of the keying material is specified in <b>BITS</b>. The InitVector is a pointer to chaining information (only used for block ciphers). The variable that this points to should be equal to the block size of the algorithm. If <em>nil</em> is specified then (if necessary) an initialization vector is automatically generated from the key. Note: the method for generating automatic IVs is different from DCPcrypt v1.31, if this is a problem uncomment the DCPcrypt v1.31 compatibility mode line in DCPcrypt2.pas.
52- <p>Init example: use the hash of a string to initialize the cipher
53- <pre>
54- <b>procedure</b> TForm1.Button1Click(Sender: TObject);
55- <b>var</b>
56- Cipher: TDCP_rc4;
57- Hash: TDCP_sha1;
58- Digest: <b>array</b>[0..19] <b>of byte</b>; <em>// SHA-1 produces a 160bit (20byte) output</em>
59- <b>begin</b>
60- Hash:= TDCP_sha1.Create(Self);
61- Hash.Init; <em>// initialize the hash</em>
62- Hash.UpdateStr(Edit1.Text); <em>// generate a hash of Edit1.Text</em>
63- Hash.Final(Digest); <em>// save the hash in Digest</em>
64- Hash.Free;
65- Cipher:= TDCP_rc4.Create(Self);
66- Cipher.Init(Digest,Sizeof(Digest)*8,<b>nil</b>); <em>// remember size is in BITS (hence sizeof*8)</em>
67- ...
68- </pre>
69- <p><font size="+1"><a name="InitStr">procedure InitStr(const Key: string; HashType: TDCP_hashclass);</a></font>
70- <p>This procedure initializes the cipher with a hash of the key string using the specified hash type (in a way similar to the example above). To replicate the behaviour from DCPcrypt v2 Beta 1 use Cipher.InitStr(KeyStr,TDCP_sha1).
71- <p>InitStr example: prompt the user for a passphrase to initialize the cipher
72- <pre>
73- <b>procedure</b> TForm1.Button1Click(Sender: TObject);
74- <b>var</b>
75- Cipher: TDCP_rc4;
76- <b>begin</b>
77- Cipher:= TDCP_rc4.Create(Self);
78- Cipher.InitStr(InputBox('Passphrase','Enter a passphrase',''),TDCP_sha1); <em>// prompt for a passphrase</em>
79- ...
80- </pre>
81- <p><font size="+1"><a name="Burn">procedure Burn;</a></font>
82- <p>Once you have finished encrypting/decrypting all your data call Burn to erase all keying information. This is automatically called once the cipher is freed, however it is a good habit to call this procedure explicitly.
83- <p><font size="+1"><a name="Reset">procedure Reset;</a></font>
84- <p>Stream ciphers (and block ciphers in chaining modes) generally store chaining information that is dependant on the information already encrypted. Consequently decrypting a block of information immediately after encrypting it won't result in the original information because when you called the decrypt procedure the chaining information was different from when you called the encrypt procedure. Hence use Reset to restore the chaining information to it's original state.
85- <p>Remember that calling <a href="#EncryptString">EncryptString</a>, <a href="#DecryptString">DecryptString</a>, <a href="#EncryptStream">EncryptStream</a> and <a href="#DecryptStream">DecryptStream</a> will also affect the chaining information.
86- <p>Reset example: encrypting and decrypting
87- <pre>
88- <b>function</b> TestCipher: <b>boolean</b>;
89- <b>const</b>
90- InData: <b>array</b>[0..9] <b>of byte</b>= ($01,$23,$45,$56,$67,$78,$89,$10,$AB,$FF);
91- <b>var</b>
92- Cipher: TDCP_rc4;
93- Data: <b>array</b>[0..9] <b>of byte</b>;
94- <b>begin</b>
95- Cipher:= TDCP_rc4.Create(<b>nil</b>);
96- Cipher.InitStr('Hello World',TDCP_sha1); <em>// initialize the cipher</em>
97- Cipher.Encrypt(InData,Data,Sizeof(Data)); <em>// encrypt some known data</em>
98- Cipher.Decrypt(Data,Data,Sizeof(Data)); <em>// now decrypt it</em>
99- Cipher.Burn; <em>// clear keying information</em>
100- Cipher.Free;
101- Result:= CompareMem(@InData,@Data,Sizeof(Data)); <em>// compare input and output</em>
102- <b>end</b>;
103- </pre>
104- The above will ALWAYS result in false due to the chaining information.
105- <pre>
106- <b>function</b> TestCipher: <b>boolean</b>;
107- <b>const</b>
108- InData: <b>array</b>[0..9] <b>of byte</b>= ($01,$23,$45,$56,$67,$78,$89,$10,$AB,$FF);
109- <b>var</b>
110- Cipher: TDCP_rc4;
111- Data: <b>array</b>[0..9] <b>of byte</b>;
112- <b>begin</b>
113- Cipher:= TDCP_rc4.Create(<b>nil</b>);
114- Cipher.InitStr('Hello World',TDCP_sha1); <em>// initialize the cipher</em>
115- Cipher.Encrypt(InData,Data,Sizeof(Data)); <em>// encrypt some known data</em>
116- Cipher.Reset; <em><b>// reset chaining information</b></em>
117- Cipher.Decrypt(Data,Data,Sizeof(Data)); <em>// now decrypt it</em>
118- Cipher.Burn; <em>// clear keying information</em>
119- Cipher.Free;
120- Result:= CompareMem(@InData,@Data,Sizeof(Data)); <em>// compare input and output</em>
121- <b>end</b>;
122- </pre>
123- The above <em>should</em> always return true.
124- <p><font size="+1"><a name="Encrypt">procedure Encrypt(const Indata; var Outdata; Size: longword);</a></font>
125- <p>Encrypt Size bytes from Indata and place it in Outdata. Block ciphers encrypt the data using the method specified by the <a href="BlockCiphers.html#CipherMode">CipherMode</a> property. Also see the notes on <a href="#Reset">Reset</a>.
126- <p><font size="+1"><a name="Decrypt">procedure Decrypt(const Indata; var Outdata; Size: longword);</a></font>
127- <p>Decrypt Size bytes from Indata and place it in Outdata. Block ciphers decrypt the data using the method specified by the <a href="BlockCiphers.html#CipherMode">CipherMode</a> property. Also see the notes on <a href="#Reset">Reset</a>.
128- <p><font size="+1"><a name="EncryptStream">function EncryptStream(InStream, OutStream: TStream; Size: longword): longword;</a></font>
129- <p>Encrypt Size bytes from the InStream and place it in the OutStream, returns the number of bytes read from the InStream. Encryption is done by calling the <a href="#Encrypt">Encrypt</a> procedure. Also see the notes on <a href="#Reset">Reset</a>.
130- <p><font size="+1"><a name="DecryptStream">function DecryptStream(InStream, OutStream: TStream; Size: longword): longword;</a></font>
131- <p>Decrypt Size bytes from the InStream and place it in the OutStream, returns the number of bytes read from the InStream. Decryption is done by calling the <a href="#Decrypt">Decrypt</a> procedure. Also see the notes on <a href="#Reset">Reset</a>.
132- <p><font size="+1"><a name="EncryptString">function EncryptString(const Str: string): string;</a></font>
133- <p>Encrypt the string Str then Base64 encode it and return the result. For stream ciphers the <a href="#Encrypt">Encrypt</a> procedure is called to do the encryption, for block ciphers the <a href="BlockCiphers.html#EncryptCFB8bit">CFB8bit</a> method is always used. Base64 encoding is used to ensure that the output string doesn't contain non-printing characters.
134- <p><font size="+1"><a name="DecryptString">function DecryptString(const Str: string): string;</a></font>
135- <p>Base64 decode the string then decrypt it and return the result. For stream ciphers the <a href="#Decrypt">Decrypt</a> procedure is called to do the decryption, for block ciphers the <a href="BlockCiphers.html#DecryptCFB8bit">CFB8bit</a> method is always used.
136- <hr>
137- <p><font size="+2"><a name="Example1">Example 1: String encryption</a></font>
138- <p>This example shows how you can encrypt the contents of a TMemo and leave the contents printable.
139- <pre>
140- <b>procedure</b> TForm1.btnEncryptClick(Sender: TObject);
141- <b>var</b>
142- i: <b>integer</b>;
143- Cipher: TDCP_rc4;
144- KeyStr: string;
145- <b>begin</b>
146- KeyStr:= '';
147- <b>if</b> InputQuery('Passphrase','Enter passphrase',KeyStr) <b>then</b> <em>// get the passphrase</em>
148- <b>begin</b>
149- Cipher:= TDCP_rc4.Create(Self);
150- Cipher.InitStr(KeyStr,TDCP_sha1); <em>// initialize the cipher with a hash of the passphrase</em>
151- <b>for</b> i:= 0 <b>to</b> Memo1.Lines.Count-1 <b>do</b> <em>// encrypt the contents of the memo</em>
152- Memo1.Lines[i]:= Cipher.EncryptString(Memo1.Lines[i]);
153- Cipher.Burn;
154- Cipher.Free;
155- <b>end</b>;
156- <b>end</b>;
157-
158- <b>procedure</b> TForm1.btnDecryptClick(Sender: TObject);
159- <b>var</b>
160- i: <b>integer</b>;
161- Cipher: TDCP_rc4;
162- KeyStr: string;
163- <b>begin</b>
164- KeyStr:= '';
165- <b>if</b> InputQuery('Passphrase','Enter passphrase',KeyStr) <b>then</b> <em>// get the passphrase</em>
166- <b>begin</b>
167- Cipher:= TDCP_rc4.Create(Self);
168- Cipher.InitStr(KeyStr,TDCP_sha1); <em>// initialize the cipher with a hash of the passphrase</em>
169- <b>for</b> i:= 0 <b>to</b> Memo1.Lines.Count-1 <b>do</b> <em>// decrypt the contents of the memo</em>
170- Memo1.Lines[i]:= Cipher.DecryptString(Memo1.Lines[i]);
171- Cipher.Burn;
172- Cipher.Free;
173- <b>end</b>;
174- <b>end</b>;
175- </pre>
176- <hr>
177- <p><font size="+2"><a name="Example2">Example 2: File encryption</a></font>
178- <p>This example shows how you can encrypt the contents of a file, takes the input and output file names from two edit boxes: boxInputFile and boxOutputFile.
179- <pre>
180- <b>procedure</b> TForm1.btnEncryptClick(Sender: TObject);
181- <b>var</b>
182- Cipher: TDCP_rc4;
183- KeyStr: string;
184- Source, Dest: TFileStream;
185- <b>begin</b>
186- KeyStr:= '';
187- <b>if</b> InputQuery('Passphrase','Enter passphrase',KeyStr) <b>then</b> <em>// get the passphrase</em>
188- <b>begin</b>
189- <b>try</b>
190- Source:= TFileStream.Create(boxInputFile.Text,fmOpenRead);
191- Dest:= TFileStream.Create(boxOutputFile.Text,fmCreate);
192- Cipher:= TDCP_rc4.Create(Self);
193- Cipher.InitStr(KeyStr,TDCP_sha1); <em>// initialize the cipher with a hash of the passphrase</em>
194- Cipher.EncryptStream(Source,Dest,Source.Size); <em>// encrypt the contents of the file</em>
195- Cipher.Burn;
196- Cipher.Free;
197- Dest.Free;
198- Source.Free;
199- MessageDlg('File encrypted',mtInformation,[mbOK],0);
200- <b>except</b>
201- MessageDlg('File IO error',mtError,[mbOK],0);
202- <b>end</b>;
203- <b>end</b>;
204- <b>end</b>;
205-
206- <b>procedure</b> TForm1.btnDecryptClick(Sender: TObject);
207- <b>var</b>
208- Cipher: TDCP_rc4;
209- KeyStr: string;
210- Source, Dest: TFileStream;
211- <b>begin</b>
212- KeyStr:= '';
213- <b>if</b> InputQuery('Passphrase','Enter passphrase',KeyStr) <b>then</b> <em>// get the passphrase</em>
214- <b>begin</b>
215- <b>try</b>
216- Source:= TFileStream.Create(boxInputFile.Text,fmOpenRead);
217- Dest:= TFileStream.Create(boxOutputFile.Text,fmCreate);
218- Cipher:= TDCP_rc4.Create(Self);
219- Cipher.InitStr(KeyStr,TDCP_sha1); <em>// initialize the cipher with a hash of the passphrase</em>
220- Cipher.DecryptStream(Source,Dest,Source.Size); <em>// decrypt the contents of the file</em>
221- Cipher.Burn;
222- Cipher.Free;
223- Dest.Free;
224- Source.Free;
225- MessageDlg('File decrypted',mtInformation,[mbOK],0);
226- <b>except</b>
227- MessageDlg('File IO error',mtError,[mbOK],0);
228- <b>end</b>;
229- <b>end</b>;
230- <b>end</b>;
231- </pre>
232- <hr>
233- <p><font size="+2"><a name="Example3">Example 3: General encryption</a></font>
234- <p>This hypothetical example shows how you might encrypt a packet of information before transmission across a network.
235- <pre>
236- <b>type</b>
237- TSomePacket= <b>record</b>
238- Date: <b>double</b>;
239- ToUserID: <b>integer</b>;
240- FromUserID: <b>integer</b>;
241- MsgLen: <b>integer</b>;
242- Msg: string;
243- <b>end</b>;
244-
245- <b>procedure</b> EncryptPacket(Cipher: TDCP_cipher; <b>var</b> Packet: TSomePacket);
246- <em>// encrypt the information packet with the cipher
247- // if the cipher isn't initialized then prompt for passphrase</em>
248- <b>begin</b>
249- <b>if</b> Cipher= <b>nil then</b>
250- <b>raise</b> Exception.Create('Cipher hasn''t been created!')
251- <b>else
252- begin</b>
253- <b>if not</b> Cipher.Initialized <b>then</b> <em>// check the cipher has been initialized</em>
254- Cipher.InitStr(InputBox('Passphrase','Enter passphrase',''),TDCP_sha1);
255- <b>if</b> Cipher <b>is</b> TDCP_blockcipher <b>then</b> <em>// if a block cipher use CFB 8bit as encrypting small packets</em>
256- TDCP_blockcipher(Cipher).CipherMode:= cmCFB8bit;
257- <em>// encrypt the record part by part, could do this in one go if it was a packed record</em>
258- Cipher.Encrypt(Packet.Date,Packet.Date,Sizeof(Packet.Date));
259- Cipher.Encrypt(Packet.ToUserID,Packet.ToUserID,Sizeof(Packet.ToUserID));
260- Cipher.Encrypt(Packet.FromUserID,Packet.FromUserID,Sizeof(Packet.FromUserID));
261- Cipher.Encrypt(Packet.MsgLen,Packet.MsgLen,Sizeof(Packet.MsgLen));
262- Cipher.Encrypt(Packet.Msg[1],Packet.Msg[1],Length(Packet.Msg)); <em>// slightly different for strings</em>
263- <em>// don't bother resetting the cipher, instead keep the chaining information</em>
264- <b>end</b>;
265- <b>end</b>;
266- </pre>
267- <p>&nbsp;
268- <p><a href="Index.html">Index</a>, <a href="BlockCiphers.html">Block Ciphers</a>, <a href="Hashes.html">Hashes</a>
269- <p>&nbsp;
270- <p><em>DCPcrypt is copyrighted &copy; 1999-2002 David Barton.<br>
271- All trademarks are property of their respective owners.</em>
272- </body>
273-</html>
Show on old repository browser