Changeset 741


Ignore:
Timestamp:
Oct 18, 2009, 6:46:01 PM (12 years ago)
Author:
Sebastian Przybylski
Message:

Moved whole content from old HowTo to Latex. Missing images, corrected content and better text formating will follow.

Location:
trunk/Documentation/Developer/PluginHowTo
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Documentation/Developer/PluginHowTo/HowToDeveloper.tex

    r385 r741  
    77\usepackage{fancyhdr}
    88\pagestyle{headings}
    9 
     9%
    1010%\pagestyle{fancy} %eigener Seitenstil
    1111%\fancyhf{} %alle Kopf- und Fußzeilenfelder bereinigen
  • trunk/Documentation/Developer/PluginHowTo/part2.tex

    r385 r741  
    1 \part{Create an Encryption-Plugin using Visual Studio 2008}
     1\part{Create an Encryption/Hash-Plugin using Visual Studio 2008}
    22
    33\section{Create a new project in VS2008 for your plugin}\label{sec:CreateANewProjectInVS2008ForYourPlugin}
     
    1414
    1515
    16 
     16[IMAGE]
    1717
    1818
    1919\section{Select the interface, your plugin wants to serve}\label{sec:SelectTheInterfaceYourPluginWantsToServe}
    20 First we have to add a reference to the Cryptool library called "`CrypPluginBase.dll"` where all necessary Cryptool plugin interfaces are declared.
    21 %Make a right click in the Solution Explorer on the "`Reference"` item and choose "`Add Reference"`. Now browse to the path where the library file is located (e.g. "`C:\backslash Documents and Settings\backslash <Username>\backslash My Documents\backslash Visual Studio 2008\backslash Projects\backslash CrypPluginBase\backslash bin\backslash Debug"`)
    22 
    23 and select the library by double clicking the file or pressing the "`OK"` button.
    24  
     20First we have to add a reference to the Cryptool library called "CrypPluginBase.dll" where all necessary Cryptool plugin interfaces are declared.
     21
     22[IMAGE]
     23
     24Make a right click in the Solution Explorer on the "Reference" item and choose "Add Reference".
     25
     26Now browse to the path where the library file is located (e.g. "C:$\backslash$Documents and Settings$\backslash$$\textless$Username$\textgreater$$\backslash$My Documents$\backslash$Visual Studio 2008$\backslash$Projects$\backslash$CrypPluginBase$\backslash$bin$\backslash$Debug")
     27
     28and select the library by double clicking the file or pressing the "OK" button.
     29
     30[IMAGE]
     31
     32Besides the CrypPluginBase you need to add three assembly references to provide the necessary "Windows" namespace for your user control functions called "Presentation" and "QuickWatchPresentation". Select the following .NET components:
     33
     34\begin{itemize}
     35    \item PresentationCore
     36    \item PresentationFramework
     37    \item WindowsBase
     38\end{itemize}
     39
     40Afterwards your reference tree view should look like this:
     41
     42[IMAGE]
     43
     44If your plugin will be based on further libraries, you have to add them in the same way.
     45
    2546
    2647\section{Create the classes for the algorithm and for its settings}\label{sec:CreateTheClassesForTheAlgorithmAndForItsSettings}
    27 \subsection{Create the class for the algorithm (MD5)}\label{sec:CreateTheClassForTheAlgorithmMD5}
    28 \subsection{Create the class for the settings (MD5Settings)}\label{sec:CreateTheClassForTheSettingsMD5Settings}
     48In the next step we have to create two classes. The first class named "Caesar" has to inherit from IEncryption to provide an ecryption plugin. If you want to develop a Hash plugin your class has to inherit from IHash.
     49The second class named "CaesarSettings" has to inherit from ISettings.
     50\subsection{Create the class for the algorithm (Caesar)}\label{sec:CreateTheClassForTheAlgorithmCaesar}
     51Visual Studio automatically creates a class which has the name "Class1.cs".  There are two ways to change the name to "Caesar.cs":
     52
     53\hspace{20pt}-Rename the existent class
     54
     55\hspace{20pt}-Delete the existent class and create a new one.
     56
     57Which one you choose is up to you. We choose the second way as you can see in the next screenshot:
     58
     59[IMAGE]
     60
     61Now make a right click on the project item "Caesar" and select "Add->Class...":
     62
     63[IMAGE]
     64
     65Now give your class a unique name. We call the class as mentioned above "Caesar.cs" and make it public to be available to other classes.
     66
     67[IMAGE]
     68
     69\subsection{Create the class for the settings (MD5Settings)}\label{sec:CreateTheClassForTheSettingsCaesarSettings}
     70Add a second public class for ISettings in the same way. We call the class "CaesarSettings". The settings class provides the necessary information about controls, captions and descriptions and default parameters for e.g. key settings, alphabets, key length and action to build the TaskPane in CrypTool. How a TaskPane could look like you can see below for the example of a Caesar encryption.
     71
     72[IMAGE]
    2973\subsection{Add namespace for the class MD5 and the place from where to inherit}
    3074\label{sec:AddNamespaceForTheClassMD5AndThePlaceFromWhereToInherit}
    31 \subsection{Add the interface functions for the class MD5}\label{sec:AddTheInterfaceFunctionsForTheClassMD5}
    32 \subsection{Add namespace and interfaces for the class MD5Settings}\label{sec:AddNamespaceAndInterfacesForTheClassMD5Settings}
    33 \subsection{Add controls for the class MD5Settings (if needed)}\label{sec:AddControlsForTheClassMD5SettingsIfNeeded}
     75Now open the "Caesar.cs" file by double clicking on it at the Solution Explorer and include the necessary namespaces to the class header by typing in the according "using" statement. The CrypTool 2.0 API provides the following namespaces:
     76
     77\hspace{20pt}-Cryptool.PluginBase = interfaces like IPlugin, IHash, ISettings, attributes, enumerations, delegates and extensions.
     78
     79\hspace{20pt}-Cryptool.PluginBase.Analysis = interface for the crypto analysis plugins like "Stream Comparator"
     80
     81\hspace{20pt}-Cryptool.PluginBase.Cryptography = interface for all encryption and hash algorithms like AES, DES or MD5 hash
     82
     83\hspace{20pt}-Cryptool.PluginBase.Editor = interface for editors you want to implement for CrypTool 2.0 like the default editor
     84
     85\hspace{20pt}-Cryptool.PluginBase.Generator = interface for generators like the random input generator
     86
     87\hspace{20pt}-Cryptool.PluginBase.IO = interface for CryptoolStream, input and output plugins like text input, file input, text output and file output
     88
     89\hspace{20pt}-Cryptool.PluginBase.Miscellaneous = provides all event helper like GuiLogMessage or PropertyChanged
     90
     91\hspace{20pt}-Cryptool.PluginBase.Tool = interface for all foreign tools which CrypTool 2.0 has to provide and which does not exactly support the CrypTool 2.0 API
     92
     93\hspace{20pt}-Cryptool.PluginBase.Validation = interface which provides method for validation like regular expression
     94
     95In this case we want to implement a Caesar algorithm which means we need to include the following namespaces:
     96
     97\hspace{20pt}-"Cryptool.PluginBase" to provide "ISettings" for the CaesarSettings class
     98
     99\hspace{20pt}-"Cryptool.PluginBase.Cryptography" to provide "IEncryption" for the Caesar class
     100
     101\hspace{20pt}-"Cryptool.PluginBase.Miscellaneous" to use the entire CrypTool event handler
     102
     103It is important to define a new default namespace of our public class ("Caesar"). In CrypTool the default namespace is presented by "Cryptool.[name of class]". Therefore our namespace has to be defined as follows: "Cryptool.Caesar".
     104 
     105Up to now the source code should look as you can see below:
     106
     107[IMAGE]
     108
     109Next let your class "Caesar" inherit from IHash by inserting of the following statement:
     110
     111[IMAGE]
     112
     113\subsection{Add the interface functions for the class Caesar}\label{sec:AddTheInterfaceFunctionsForTheClassMD5}
     114There is an underscore at the I in IEncryption statement. Move your mouse over it or place the cursor at it and press "Shift+Alt+F10" and you will see the following submenu:
     115
     116[IMAGE]
     117
     118Choose the item "Implement interface 'IEncryption'". Visual Studio will now place all available and needed interface members to interact with the CrypTool core (this saves you also a lot of typing code).
     119 
     120Your code will now look like this:
     121
     122[IMAGE]
     123
     124
     125
     126\subsection{Add namespace and interfaces for the class CaesarSettings}\label{sec:AddNamespaceAndInterfacesForTheClassMD5Settings}
     127Let's now take a look at the second class "CaesarSettings" by double clicking at the "CaesarSettings.cs" file at the Solution Explorer. First we also have to include the namespace of "Cryptool.PluginBase" to the class header and let the settings class inherit from "ISettings" analogous as seen before at the Caesar class. Visual Studio will here also automatically place code from the CrypTool interface if available.
     128
     129[IMAGE]
     130
     131\subsection{Add controls for the class CaesarSettings (if needed)}\label{sec:AddControlsForTheClassMD5SettingsIfNeeded}
     132Now we have to implement some kind of controls (like button, text box) if we need them in the CrypTool \textbf{TaskPane} to modify settings of the algorithm.
     133 
    34134\section{Select and add an image as icon for the class MD5}\label{sec:SelectAndAddAnImageAsIconForTheClassMD5}
    35 \section{Set the attributes for the class MD5}\label{sec:SetTheAttributesForTheClassMD5}
    36 \section{Set the private variables for the settings in the class MD5}
     135Before we go back to the code of the Caesar class, we have to add an icon image to our project, which will be shown in the CrypTool ribbon bar or/and navigation pane. As there is no default, using an icon image is mandatory.
     136Note: This will be changed in future. A default icon will be used if no icon image has been provided.
     137For testing purposes you may create a simple black and white PNG image with MS Paint or Paint.NET. As image size you can use 40x40 pixels for example, but as the image will be scaled when required, any size should do it. Place the image file in your project directory or in a subdirectory. Then make a right click on the project item "Caesar" within the Solution Explorer, and select "Add$\textendash$$\textgreater$Existing Item...":
     138
     139[IMAGE]
     140
     141Then select "Image Files" as file type, and choose the icon for your plugin:
     142
     143[IMAGE]
     144
     145Finally we have to set the icon as a "Resource" to avoid providing the icon as a separate file. Make a right click on the icon and select the item "Properties":
     146
     147[IMAGE]
     148
     149In the "Properties" panel you have to set the "Build Action" to "Resource" (not embedded resource):
     150
     151[IMAGE]
     152
     153
     154\section{Set the attributes for the class Caesar}\label{sec:SetTheAttributesForTheClassMD5}
     155Now let's go back to the code of the Caesar class ("Caesar.cs" file). First we have to set the necessary attributes for our class. This attributes are used to provide additional information for the Cryptool 2.0 environment. If not set, your plugin won't show up in the GUI, even if everything else is implemented correctly.
     156
     157Attributes are used for declarative programming and provide meta data, that can be attached to the existing .NET meta data , like classes and properties. Cryptool provides a set of custom attributes, that are used to mark the different parts of your plugin.
     158
     159\textit{[Author]}
     160
     161The first attribute called "Author" is optional, which means we are not forced to define this attribute. It provides the additional information about the plugin developer. We set this attribute to demonstrate how it has to look in case you want to provide this attribute.
     162
     163[IMAGE]
     164
     165As we can see above the author attribute takes four elements of type string. These elements are:
     166
     167\hspace{20pt}-Author = name of the plugin developer
     168
     169\hspace{20pt}-Email = email of the plugin developer if he wants to be contact
     170
     171\hspace{20pt}-Institute = current employment of the developer like University or Company
     172
     173\hspace{20pt}-Url = the website or homepage of the developer
     174
     175All this elements are also optional. The developer decides what he wants to publish. Unused elements shall be set to null or a zero-length string ("").
     176Our author attribute should look now as you can see below:
     177
     178[IMAGE]
     179
     180\textit{[PluginInfo]}
     181The second attribute called "PluginInfo" provides the necessary information about the plugin like caption and tool tip. This attribute is mandatory. The attribute has the definition as you can see below:
     182
     183[IMAGE]
     184
     185This attribute expects the following elements:
     186
     187\hspace{20pt}o\hspace{10pt}startable =
     188Set this flag to true only if your plugin is some kind of input or generator plugin (probably if your plugin just has outputs and no inputs). In all other cases use false here. This flag is important. Setting this flag to true for a non input/generator plugin will result in unpredictable chain runs. This element is mandatory.
     189
     190\hspace{20pt}o\hspace{10pt}caption =
     191from type string, the name of the plugin (e.g. to provide the button content). This element is mandatory.
     192
     193\hspace{20pt}o\hspace{10pt}toolTip = from type string, description of the plugin (e.g. to provide the button tool tip). This element is optional.
     194
     195\hspace{20pt}o\hspace{10pt}descriptionUrl = from type string, define where to find the whole description files (e.g. XAML files). This element is optional.
     196o       icons = from type string array, which provides all necessary icon paths you want to use in the plugin (e.g. the plugin icon as seen above). This element is mandatory.
     197
     198Unused optional elements shall be set to null or a zero-length string ("").
     199
     200$\small$Note 1: It is possible to use the plugin without setting a caption though it is not recommended. This will be changed in future and the plugin will fail to load without a caption.
     201
     202Note 2: Currently a zero-length toolTip string appears as empty box. This will be changed in future.
     203
     204Note 3: Tooltip and description currently do not support internationalization and localization. This will be changed in future.
     205
     206In our example the first parameter called "startable" has to be set to "false", because our hash algorithm is neither an input nor generator plugin.
     207
     208[IMAGE]
     209
     210The next two parameters are needed to define the plugin's name and its description:
     211
     212[IMAGE]
     213
     214The fourth element defines the location path of the description file. The parameter is made up by $\guilsinglleft$Assembly name$\guilsinglright$/$\guilsinglleft$filename$\guilsinglright$ or $\guilsinglleft$Assembly name$\guilsinglright$/$\guilsinglleft$Path$\guilsinglright$/$\guilsinglleft$file name$\guilsinglright$ if you want to store your description files in a separate folder. The description file has to be of type XAML. In our case we create a folder called "DetailedDescription" and store our XAML file there with the necessary images if needed. How you manage the files and folders is up to you. This folder could now look as you can see below:
     215
     216[IMAGE]
     217
     218Accordingly the attribute parameter has to be set to:
     219
     220[IMAGE]
     221
     222The detailed description could now look like this in CrypTool (right click plugin icon on workspace and select "Show description"):
     223
     224[IMAGE]
     225
     226The last parameter tells CrypTool the names of the provided icons. This parameter is made up by $\guilsinglleft$Assembly name$\guilsinglright$/$\guilsinglleft$file name$\guilsinglright$ or $\guilsinglleft$Assembly name$\guilsinglright$/$\guilsinglleft$Path$\guilsinglright$/$\guilsinglleft$file name$\guilsinglright$.
     227
     228The most important icon is the plugin icon, which will be shown in CrypTool in the ribbon bar or navigation pane (This is the first icon in list, so you have to provide at least one icon for a plugin). As named above how to add an icon to the solution accordingly we have to tell CrypTool where to find the icon by setting this parameter as you can see below:
     229
     230[IMAGE]
     231
     232You can define further icon paths if needed, by adding the path string separated by a comma.
     233\section{Set the private variables for the settings in the class Caesar}
    37234\label{sec:SetThePrivateVariablesForTheSettingsInTheClassMD5}
    38 \section{Define the code of the class MD5 to fit the interface}\label{sec:DefineTheCodeOfTheClassMD5ToFitTheInterface}
    39 \section{Complete the actual code for the class MD5}\label{sec:CompleteTheActualCodeForTheClassMD5}
     235The next step is to define some private variables needed for the settings, input and output data which could look like this:
     236
     237[IMAGE]
     238
     239Please notice the sinuous line at the type "CryptoolStream" of the variable inputData and the list listCryptoolStreamsOut. "CryptoolStream" is a data type for input and output between plugins and is able to handle large data amounts. To use the CrypTool own stream type, include the namespace "Cryptool.PluginBase.IO" with a "using" statement as explained in chapter 3.3.
     240
     241The following private variables are being used in this example:
     242
     243\hspace{20pt}-CaesarSettings settings: required to implement the IPlugin interface properly
     244
     245\hspace{20pt}-CryptoolStream inputData: stream to read the input data from
     246
     247\hspace{20pt}-byte[] outputData: byte array to save the output hash value
     248
     249\hspace{20pt}-List$\guilsinglleft$CryptoolStream$\guilsinglright$ listCryptoolStreamsOut: list of all streams being created by Caesar plugin, required to perform a clean dispose
     250
     251
     252\section{Define the code of the class Caesar to fit the interface}\label{sec:DefineTheCodeOfTheClassMD5ToFitTheInterface}
     253Next we have to complete our code to correctly serve the interface.
     254
     255First we add a constructor to our class where we can create an instance of our settings class:
     256
     257[IMAGE]
     258
     259Secondly, we have to implement the property "Settings" defined in the interface:
     260
     261[IMAGE]
     262
     263Thirdly we have to define two properties with their according attributes. This step is necessary to tell Cryptool that these properties are input/output properties used for data exchange with other plugins.
     264
     265The attribute is named "PropertyInfo" and consists of the following elements:
     266
     267\hspace{20pt}-direction = defines whether this property is an input or output property, i.e. whether it reads input data or writes output data
     268
     269\hspace{30pt}o\hspace{10pt}Direction.Input
     270
     271\hspace{30pt}o\hspace{10pt}Direction.Output
     272
     273\hspace{20pt}-caption = caption of the property (e.g. shown at the input on the dropped icon in the editor), see below:
     274
     275[IMAGE]
     276
     277\hspace{20pt}-toolTip = tooltip of the property (e.g. shown at the input arrow on the dropped icon in the editor), see above
     278
     279\hspace{20pt}-descriptionUrl = not used right now
     280
     281\hspace{20pt}-mandatory = this flag defines whether an input is required to be connected by the user. If set to true, there has to be an input connection that provides data. If no input data is provided for mandatory input, your plugin will not be executed in the workflow chain. If set to false, connecting the input is optional. This only applies to input properties. If using Direction.Output, this flag is ignored.
     282
     283\hspace{20pt}-hasDefaultValue = if this flag is set to true, CrypTool treats this plugin as though the input has already input data.
     284
     285\hspace{20pt}-DisplayLevel = define in which display levels your property will be shown in CrypTool. CrypTool provides the following display levels:
     286
     287\hspace{30pt}o\hspace{10pt}DisplayLevel.Beginner
     288
     289\hspace{30pt}o\hspace{10pt}DisplayLevel.Experienced
     290
     291\hspace{30pt}o\hspace{10pt}DisplayLevel.Expert
     292
     293\hspace{30pt}o\hspace{10pt}DisplayLevel.Professional
     294
     295\hspace{20pt}-QuickWatchFormat = defines how the content of the property will be shown in the quick watch. CrypTool accepts the following quick watch formats:
     296
     297\hspace{30pt}o\hspace{10pt}QuickWatchFormat.Base64
     298
     299\hspace{30pt}o\hspace{10pt}QuickWatchFormat.Hex
     300
     301\hspace{30pt}o\hspace{10pt}QuickWatchFormat.None
     302
     303\hspace{30pt}o\hspace{10pt}QuickWatchFormat.Text
     304
     305A quick watch in Hex could look like this:
     306
     307[IMAGE]
     308
     309\hspace{20pt}-quickWatchConversionMethod = this string points to a conversion method; most plugins can use a "null" value here, because no conversion is necessary. The QuickWatch function uses system "default" encoding to display data. So only if your data is in some other format, like Unicode or UTF8, you have to provide the name of a conversion method as string. The method header has to look like this:
     310object YourMethodName(string PropertyNameToConvert)
     311
     312First we define the "InputData" property getter and setter:
     313
     314[IMAGE]
     315
     316In the getter we check if the input data is not null. If input data is filled, we declare a new CryptoolStream to read the input data, open it and add it to our list where all output stream references are stored. Finally the new stream will be returned.
     317
     318$\small$Note 1: It is currently not possible to read directly from the input data stream without creating an intermediate CryptoolStream.
     319
     320$\small$Note 2: The naming may be confusing. The new CryptoolStream is not an output stream, but it is added to the list of output streams to enable a clean dispose afterwards. See chapter 9 below.
     321
     322The setter sets the new input data and announces the data to the Cryptool 2.0 environment by using the expression "OnPropertyChanged("$\guilsinglleft$Property name$\guilsinglright$"). For input properties this step is necessary to update the quick watch view.
     323
     324The output data property could look like this:
     325
     326[IMAGE]
     327
     328CrypTool does not require implementing output setters, as they will never be called from outside of the plugin. Nevertheless in this example our plugin accesses the property itself, therefore we chose to implement the setter.
     329
     330You can also provide additional output data types if you like. For example we provide also an output data of type CryptoolStream:
     331
     332[IMAGE]
     333
     334This property's setter is not called and therefore not implemented.
     335
     336Notice the method "GuiLogMessage" in the source codes above. This method is used to send messages to the CrypTool status bar. This is a nice feature to inform the user what your plugin is currently doing.
     337
     338[IMAGE]
     339
     340The method takes two parameters which are:
     341
     342\hspace{20pt}-Message = will be shown in the status bar and is of type string
     343
     344\hspace{20pt}-NotificationLevel = to group the messages to their alert level
     345
     346\hspace{30pt}o\hspace{10pt}NotificationLevel.Error
     347
     348\hspace{30pt}o\hspace{10pt}NotificationLevel.Warning
     349
     350\hspace{30pt}o\hspace{10pt}NotificationLevel.Info
     351
     352\hspace{30pt}o\hspace{10pt}NotificationLevel.Debug
     353
     354As we can recognize we have two methods named "OnPropertyChanged" and "GuiLogMessage" which are not defined. So we have to define these two methods as you can see below:
     355
     356[IMAGE]
     357
     358To use the "PropertyChangedEventHandler" you have to include the namespace "System.ComponentModel".
     359
     360Our whole included namespaces looks now like this:
     361
     362[IMAGE]
     363
     364
     365\section{Complete the actual code for the class Caesar}\label{sec:CompleteTheActualCodeForTheClassMD5}
     366Up to now, the plugin is ready for the CrypTool base application to be accepted and been shown correctly in the CrypTool menu. What we need now, is the implementation of the actual algorithm in the function "Execute()" which is up to you as the plugin developer.
     367
     368Let us demonstrate the Execute() function, too. Our algorithm is based on the .NET framework:
     369
     370[IMAGE]
     371
     372It is important to make sure that all changes of output properties will be announced to the CrypTool environment. In this example this happens by calling the setter of OutputData which in turn calls "OnPropertyChanged" for both output properties "OutputData" and "OutputDataStream". Instead of calling the property's setter you can as well call "OnPropertyChanged" directly within the "Execute()" method.
     373
     374Certainly you have seen the unknown method "ProgressChanged" which you can use to show the current algorithm process as a progress on the plugin icon.
     375To use this method you also have to declare this method to afford a successful compilation:
     376
     377[IMAGE]
     378
     379\section{Perform a clean dispose}\label{sec:PerformACleanDispose}
     380Be sure you have closed and cleaned all your streams after execution and when CrypTool decides to dispose the plugin instance. Though not required, we run the dispose code before execution as well:
     381
     382[IMAGE]
     383\section{Finish implementation}\label{sec:FinishImplementation}
     384When adding plugin instances to the CrypTool workspace, CrypTool checks whether the plugin runs without any exception. If any IPlugin method throws an exception, CrypTool will show an error and prohibit using the plugin. Therefore we have to remove the "NotImplementedException" from the methods "Initialize()", "Pause()" and "Stop()". In our example it's sufficient to provide empty implementations.
     385
     386[IMAGE]
     387
     388The methods "Presentation()" and "QuickWatchPresentation()" can be used if a plugin developer wants to provide an own visualization of the plugin algorithm which will be shown in CrypTool. Take a look at the PRESENT plugin to see how a custom visualization can be realized. For our Caesar example we don't want to implement a custom visualization, therefore we return "null":
     389
     390[IMAGE]
     391
     392Your plugin should compile without errors at this point.
    40393\section{Sign the created plugin}\label{sec:SignTheCreatedPlugin}
     394
    41395\section{Import the plugin to Cryptool and test it}\label{sec:ImportThePluginToCryptoolAndTestIt}
     396After you have built the plugin, you need to move the newly created plugin DLL to a location, where CrypTool can find it. To do this, there are the following ways:
     397
     398\hspace{20pt}1. Copy your plugin DLL file in the folder "CrypPlugins" which has to be in the same folder as the CrypTool executable, called "CrypWin.exe". If necessary, create the folder "CrypPlugins". This folder is called "Global storage" in the CrypTool architecture. Changes in this folder will take effect for all users on a multi user Windows. Finally restart CrypTool.
     399
     400[IMAGE]
     401
     402\hspace{20pt}2. Copy your plugin DLL file in the folder "CrypPlugins" which is located in your home path in the folder "ApplicationData" and restart CrypTool.  This home folder path is called "Custom storage" in the CrypTool architecture. Changes in this folder will only take effect for current user.  On a German Windows XP the home folder path could look like:
     403"C:$\backslash$Dokumente und Einstellungen$\backslash$$\guilsinglleft$User$\guilsinglright$$\backslash$Anwendungsdaten$\backslash$CrypPlugins" and in Vista the path will look like "C:$\backslash$Users$\backslash$$\guilsinglleft$user$\guilsinglright$$\backslash$Application Data$\backslash$CrypPlugins".
     404
     405[IMAGE]
     406
     407\hspace{20pt}3. You can also import new plugins directly from the CrypTool interface. Just execute CrypWin.exe and select the "Download Plugins" button. An "Open File Dialog" will open and ask where the new plugin is located. After selecting the new plugin, CrypTool will automatically import the new plugin in the custom storage folder. With this option you will not have to restart CrypTool. All according menu entries will be updated automatically.
     408Notice, that this plugin importing function only accepts signed plugins.
     409
     410This option is a temporary solution for importing new plugins. In the future this will be done online by a web service.
     411
     412\hspace{20pt}4. Use post-build in your project properties to copy the DLL automatically after building it in Visual Studio. Right-click on your plugin project and select "Properties":
     413
     414[IMAGE]
     415
     416Select "Build Events":
     417
     418[IMAGE]
     419
     420Enter the following text snippet into "Post-build event command line":
     421
     422cd "\$(ProjectDir)"
     423
     424cd ..$\backslash$..$\backslash$CrypWin$\backslash$\$(OutDir)
     425
     426if not exist "./CrypPlugins" mkdir "./CrypPlugins"
     427
     428del /F /S /Q /s /q "Caesar*.*"
     429
     430copy "\$(TargetDir)Caesar*.*" "./CrypPlugins"
     431
     432You need to adapt the yellow marked field to your actual project name.
     433
    42434\section{Source code and source template}\label{sec:SourceCodeAndSourceTemplate}
     435Here you can download the whole source code which was presented in this "Howto" as a Visual Studio solution:
     436
     437username: anonymous\newline
     438password: not required
     439
     440https://www.cryptool.org/svn/CrypTool2/trunk/CrypPlugins/Caesar/
     441
     442
     443Here you can download the Visual Studio plugin template to begin with the development of a new Cryptool plugin:
     444
     445http://cryptool2.vs.uni-due.de/downloads/template/encryptionplugin.zip
     446
     447\section{Provide a workflow file of your plugin}\label{ProvideAWorkflowFileOfYourPlugin}
     448Every plugin developer should provide a workflow file which shows his algorithm working in CrypTool2. You will automatically create a workflow file by saving your project which was created on CrypTool2 work space. Here is an example how a workflow could look like:
     449
     450[IMAGE]
Note: See TracChangeset for help on using the changeset viewer.