source upload
This commit is contained in:
@@ -0,0 +1,261 @@
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Condition="Exists('$(BDS)\bin\CodeGear.Deployment.targets')" Project="$(BDS)\bin\CodeGear.Deployment.targets"/>
|
||||
<ProjectExtensions>
|
||||
<ProjectFileVersion>12</ProjectFileVersion>
|
||||
</ProjectExtensions>
|
||||
<PropertyGroup>
|
||||
<DeviceId Condition="'$(Platform)'=='Android'">CB512EA59X</DeviceId>
|
||||
<DeviceId Condition="'$(Platform)'=='Android64'"/>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition="'$(Platform)'=='Win32'">
|
||||
<DeployFile Include="..\..\Compiled\BIN_IDExx.x_Win32__Demos\Cipher_Console.exe" Condition="'$(Config)'=='Debug'">
|
||||
<RemoteDir>Cipher_Console\</RemoteDir>
|
||||
<RemoteName>Cipher_Console.exe</RemoteName>
|
||||
<DeployClass>ProjectOutput</DeployClass>
|
||||
<Operation>0</Operation>
|
||||
<LocalCommand/>
|
||||
<RemoteCommand/>
|
||||
<Overwrite>True</Overwrite>
|
||||
<Required>True</Required>
|
||||
</DeployFile>
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="'$(Platform)'=='Win64'"/>
|
||||
<ItemGroup Condition="'$(Platform)'=='Android'">
|
||||
<DeployFile Include="$(BDS)\bin\Artwork\Android\FM_NotificationIcon_72x72.png" Condition="'$(Config)'=='Debug'">
|
||||
<RemoteDir>Cipher_Console\res\drawable-xxhdpi\</RemoteDir>
|
||||
<RemoteName>ic_notification.png</RemoteName>
|
||||
<DeployClass>Android_NotificationIcon72</DeployClass>
|
||||
<Operation>1</Operation>
|
||||
<LocalCommand/>
|
||||
<RemoteCommand/>
|
||||
<Overwrite>True</Overwrite>
|
||||
</DeployFile>
|
||||
<DeployFile Include="$(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png" Condition="'$(Config)'=='Debug'">
|
||||
<RemoteDir>Cipher_Console\res\drawable-ldpi\</RemoteDir>
|
||||
<RemoteName>ic_launcher.png</RemoteName>
|
||||
<DeployClass>Android_LauncherIcon36</DeployClass>
|
||||
<Operation>1</Operation>
|
||||
<LocalCommand/>
|
||||
<RemoteCommand/>
|
||||
<Overwrite>True</Overwrite>
|
||||
</DeployFile>
|
||||
<DeployFile Include="..\..\Compiled\BIN_IDExx.x_Android__Demos\AndroidManifest.xml" Condition="'$(Config)'=='Debug'">
|
||||
<RemoteDir>Cipher_Console\</RemoteDir>
|
||||
<RemoteName>AndroidManifest.xml</RemoteName>
|
||||
<DeployClass>ProjectAndroidManifest</DeployClass>
|
||||
<Operation>1</Operation>
|
||||
<LocalCommand/>
|
||||
<RemoteCommand/>
|
||||
<Overwrite>True</Overwrite>
|
||||
</DeployFile>
|
||||
<DeployFile Include="..\..\Compiled\BIN_IDExx.x_Android__Demos\colors.xml" Condition="'$(Config)'=='Debug'">
|
||||
<RemoteDir>Cipher_Console\res\values\</RemoteDir>
|
||||
<RemoteName>colors.xml</RemoteName>
|
||||
<DeployClass>Android_Colors</DeployClass>
|
||||
<Operation>1</Operation>
|
||||
<LocalCommand/>
|
||||
<RemoteCommand/>
|
||||
<Overwrite>True</Overwrite>
|
||||
</DeployFile>
|
||||
<DeployFile Include="$(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png" Condition="'$(Config)'=='Debug'">
|
||||
<RemoteDir>Cipher_Console\res\drawable-hdpi\</RemoteDir>
|
||||
<RemoteName>ic_launcher.png</RemoteName>
|
||||
<DeployClass>Android_LauncherIcon72</DeployClass>
|
||||
<Operation>1</Operation>
|
||||
<LocalCommand/>
|
||||
<RemoteCommand/>
|
||||
<Overwrite>True</Overwrite>
|
||||
</DeployFile>
|
||||
<DeployFile Include="$(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png" Condition="'$(Config)'=='Debug'">
|
||||
<RemoteDir>Cipher_Console\res\drawable-large\</RemoteDir>
|
||||
<RemoteName>splash_image.png</RemoteName>
|
||||
<DeployClass>Android_SplashImage640</DeployClass>
|
||||
<Operation>1</Operation>
|
||||
<LocalCommand/>
|
||||
<RemoteCommand/>
|
||||
<Overwrite>True</Overwrite>
|
||||
</DeployFile>
|
||||
<DeployFile Include="$(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png" Condition="'$(Config)'=='Debug'">
|
||||
<RemoteDir>Cipher_Console\res\drawable-xlarge\</RemoteDir>
|
||||
<RemoteName>splash_image.png</RemoteName>
|
||||
<DeployClass>Android_SplashImage960</DeployClass>
|
||||
<Operation>1</Operation>
|
||||
<LocalCommand/>
|
||||
<RemoteCommand/>
|
||||
<Overwrite>True</Overwrite>
|
||||
</DeployFile>
|
||||
<DeployFile Include="$(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png" Condition="'$(Config)'=='Debug'">
|
||||
<RemoteDir>Cipher_Console\res\drawable-small\</RemoteDir>
|
||||
<RemoteName>splash_image.png</RemoteName>
|
||||
<DeployClass>Android_SplashImage426</DeployClass>
|
||||
<Operation>1</Operation>
|
||||
<LocalCommand/>
|
||||
<RemoteCommand/>
|
||||
<Overwrite>True</Overwrite>
|
||||
</DeployFile>
|
||||
<DeployFile Include="..\..\Compiled\BIN_IDExx.x_Android__Demos\styles.xml" Condition="'$(Config)'=='Debug'">
|
||||
<RemoteDir>Cipher_Console\res\values\</RemoteDir>
|
||||
<RemoteName>styles.xml</RemoteName>
|
||||
<DeployClass>AndroidSplashStyles</DeployClass>
|
||||
<Operation>1</Operation>
|
||||
<LocalCommand/>
|
||||
<RemoteCommand/>
|
||||
<Overwrite>True</Overwrite>
|
||||
</DeployFile>
|
||||
<DeployFile Include="..\..\Compiled\BIN_IDExx.x_Android__Demos\classes.dex" Condition="'$(Config)'=='Debug'">
|
||||
<RemoteDir>Cipher_Console\classes\</RemoteDir>
|
||||
<RemoteName>classes.dex</RemoteName>
|
||||
<DeployClass>AndroidClassesDexFile</DeployClass>
|
||||
<Operation>1</Operation>
|
||||
<LocalCommand/>
|
||||
<RemoteCommand/>
|
||||
<Overwrite>True</Overwrite>
|
||||
</DeployFile>
|
||||
<DeployFile Include="$(BDS)\bin\Artwork\Android\FM_NotificationIcon_36x36.png" Condition="'$(Config)'=='Debug'">
|
||||
<RemoteDir>Cipher_Console\res\drawable-hdpi\</RemoteDir>
|
||||
<RemoteName>ic_notification.png</RemoteName>
|
||||
<DeployClass>Android_NotificationIcon36</DeployClass>
|
||||
<Operation>1</Operation>
|
||||
<LocalCommand/>
|
||||
<RemoteCommand/>
|
||||
<Overwrite>True</Overwrite>
|
||||
</DeployFile>
|
||||
<DeployFile Include="$(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png" Condition="'$(Config)'=='Debug'">
|
||||
<RemoteDir>Cipher_Console\res\drawable-mdpi\</RemoteDir>
|
||||
<RemoteName>ic_launcher.png</RemoteName>
|
||||
<DeployClass>Android_LauncherIcon48</DeployClass>
|
||||
<Operation>1</Operation>
|
||||
<LocalCommand/>
|
||||
<RemoteCommand/>
|
||||
<Overwrite>True</Overwrite>
|
||||
</DeployFile>
|
||||
<DeployFile Include="$(BDS)\lib\android\debug\mips\libnative-activity.so" Condition="'$(Config)'=='Debug'">
|
||||
<RemoteDir>Cipher_Console\library\lib\mips\</RemoteDir>
|
||||
<RemoteName>libCipher_Console.so</RemoteName>
|
||||
<DeployClass>AndroidLibnativeMipsFile</DeployClass>
|
||||
<Operation>1</Operation>
|
||||
<LocalCommand/>
|
||||
<RemoteCommand/>
|
||||
<Overwrite>True</Overwrite>
|
||||
</DeployFile>
|
||||
<DeployFile Include="$(NDKBasePath)\prebuilt\android-arm\gdbserver\gdbserver" Condition="'$(Config)'=='Debug'">
|
||||
<RemoteDir>Cipher_Console\library\lib\armeabi-v7a\</RemoteDir>
|
||||
<RemoteName>gdbserver</RemoteName>
|
||||
<DeployClass>AndroidGDBServer</DeployClass>
|
||||
<Operation>1</Operation>
|
||||
<LocalCommand/>
|
||||
<RemoteCommand/>
|
||||
<Overwrite>True</Overwrite>
|
||||
</DeployFile>
|
||||
<DeployFile Include="..\..\Compiled\BIN_IDExx.x_Android__Demos\libCipher_Console.so" Condition="'$(Config)'=='Debug'">
|
||||
<RemoteDir>Cipher_Console\library\lib\armeabi-v7a\</RemoteDir>
|
||||
<RemoteName>libCipher_Console.so</RemoteName>
|
||||
<DeployClass>ProjectOutput</DeployClass>
|
||||
<Operation>1</Operation>
|
||||
<LocalCommand/>
|
||||
<RemoteCommand/>
|
||||
<Overwrite>True</Overwrite>
|
||||
<Required>True</Required>
|
||||
</DeployFile>
|
||||
<DeployFile Include="..\..\Compiled\BIN_IDExx.x_Android__Demos\strings.xml" Condition="'$(Config)'=='Debug'">
|
||||
<RemoteDir>Cipher_Console\res\values\</RemoteDir>
|
||||
<RemoteName>strings.xml</RemoteName>
|
||||
<DeployClass>Android_Strings</DeployClass>
|
||||
<Operation>1</Operation>
|
||||
<LocalCommand/>
|
||||
<RemoteCommand/>
|
||||
<Overwrite>True</Overwrite>
|
||||
</DeployFile>
|
||||
<DeployFile Include="$(BDS)\bin\Artwork\Android\FM_NotificationIcon_96x96.png" Condition="'$(Config)'=='Debug'">
|
||||
<RemoteDir>Cipher_Console\res\drawable-xxxhdpi\</RemoteDir>
|
||||
<RemoteName>ic_notification.png</RemoteName>
|
||||
<DeployClass>Android_NotificationIcon96</DeployClass>
|
||||
<Operation>1</Operation>
|
||||
<LocalCommand/>
|
||||
<RemoteCommand/>
|
||||
<Overwrite>True</Overwrite>
|
||||
</DeployFile>
|
||||
<DeployFile Include="$(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png" Condition="'$(Config)'=='Debug'">
|
||||
<RemoteDir>Cipher_Console\res\drawable-xxhdpi\</RemoteDir>
|
||||
<RemoteName>ic_launcher.png</RemoteName>
|
||||
<DeployClass>Android_LauncherIcon144</DeployClass>
|
||||
<Operation>1</Operation>
|
||||
<LocalCommand/>
|
||||
<RemoteCommand/>
|
||||
<Overwrite>True</Overwrite>
|
||||
</DeployFile>
|
||||
<DeployFile Include="..\..\Compiled\BIN_IDExx.x_Android__Demos\styles-v21.xml" Condition="'$(Config)'=='Debug'">
|
||||
<RemoteDir>Cipher_Console\res\values-v21\</RemoteDir>
|
||||
<RemoteName>styles.xml</RemoteName>
|
||||
<DeployClass>AndroidSplashStylesV21</DeployClass>
|
||||
<Operation>1</Operation>
|
||||
<LocalCommand/>
|
||||
<RemoteCommand/>
|
||||
<Overwrite>True</Overwrite>
|
||||
</DeployFile>
|
||||
<DeployFile Include="$(BDS)\lib\android\debug\armeabi\libnative-activity.so" Condition="'$(Config)'=='Debug'">
|
||||
<RemoteDir>Cipher_Console\library\lib\armeabi\</RemoteDir>
|
||||
<RemoteName>libCipher_Console.so</RemoteName>
|
||||
<DeployClass>AndroidLibnativeArmeabiFile</DeployClass>
|
||||
<Operation>1</Operation>
|
||||
<LocalCommand/>
|
||||
<RemoteCommand/>
|
||||
<Overwrite>True</Overwrite>
|
||||
</DeployFile>
|
||||
<DeployFile Include="$(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png" Condition="'$(Config)'=='Debug'">
|
||||
<RemoteDir>Cipher_Console\res\drawable-normal\</RemoteDir>
|
||||
<RemoteName>splash_image.png</RemoteName>
|
||||
<DeployClass>Android_SplashImage470</DeployClass>
|
||||
<Operation>1</Operation>
|
||||
<LocalCommand/>
|
||||
<RemoteCommand/>
|
||||
<Overwrite>True</Overwrite>
|
||||
</DeployFile>
|
||||
<DeployFile Include="..\..\Compiled\BIN_IDExx.x_Android__Demos\splash_image_def.xml" Condition="'$(Config)'=='Debug'">
|
||||
<RemoteDir>Cipher_Console\res\drawable\</RemoteDir>
|
||||
<RemoteName>splash_image_def.xml</RemoteName>
|
||||
<DeployClass>AndroidSplashImageDef</DeployClass>
|
||||
<Operation>1</Operation>
|
||||
<LocalCommand/>
|
||||
<RemoteCommand/>
|
||||
<Overwrite>True</Overwrite>
|
||||
</DeployFile>
|
||||
<DeployFile Include="$(BDS)\bin\Artwork\Android\FM_NotificationIcon_24x24.png" Condition="'$(Config)'=='Debug'">
|
||||
<RemoteDir>Cipher_Console\res\drawable-mdpi\</RemoteDir>
|
||||
<RemoteName>ic_notification.png</RemoteName>
|
||||
<DeployClass>Android_NotificationIcon24</DeployClass>
|
||||
<Operation>1</Operation>
|
||||
<LocalCommand/>
|
||||
<RemoteCommand/>
|
||||
<Overwrite>True</Overwrite>
|
||||
</DeployFile>
|
||||
<DeployFile Include="$(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png" Condition="'$(Config)'=='Debug'">
|
||||
<RemoteDir>Cipher_Console\res\drawable-xhdpi\</RemoteDir>
|
||||
<RemoteName>ic_launcher.png</RemoteName>
|
||||
<DeployClass>Android_LauncherIcon96</DeployClass>
|
||||
<Operation>1</Operation>
|
||||
<LocalCommand/>
|
||||
<RemoteCommand/>
|
||||
<Overwrite>True</Overwrite>
|
||||
</DeployFile>
|
||||
<DeployFile Include="$(BDS)\bin\Artwork\Android\FM_NotificationIcon_48x48.png" Condition="'$(Config)'=='Debug'">
|
||||
<RemoteDir>Cipher_Console\res\drawable-xhdpi\</RemoteDir>
|
||||
<RemoteName>ic_notification.png</RemoteName>
|
||||
<DeployClass>Android_NotificationIcon48</DeployClass>
|
||||
<Operation>1</Operation>
|
||||
<LocalCommand/>
|
||||
<RemoteCommand/>
|
||||
<Overwrite>True</Overwrite>
|
||||
</DeployFile>
|
||||
<DeployFile Include="$(BDS)\bin\Artwork\Android\FM_LauncherIcon_192x192.png" Condition="'$(Config)'=='Debug'">
|
||||
<RemoteDir>Cipher_Console\res\drawable-xxxhdpi\</RemoteDir>
|
||||
<RemoteName>ic_launcher.png</RemoteName>
|
||||
<DeployClass>Android_LauncherIcon192</DeployClass>
|
||||
<Operation>1</Operation>
|
||||
<LocalCommand/>
|
||||
<RemoteCommand/>
|
||||
<Overwrite>True</Overwrite>
|
||||
</DeployFile>
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="'$(Platform)'=='Android64'"/>
|
||||
</Project>
|
@@ -0,0 +1,96 @@
|
||||
{*****************************************************************************
|
||||
The DEC team (see file NOTICE.txt) licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. A copy of this licence is found in the root directory of
|
||||
this project in the file LICENCE.txt or alternatively at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*****************************************************************************}
|
||||
|
||||
/// <summary>
|
||||
/// Most simple demonstration of using a DEC cipher
|
||||
/// </summary>
|
||||
program Cipher_Console;
|
||||
|
||||
{$APPTYPE CONSOLE}
|
||||
|
||||
{$R *.res}
|
||||
|
||||
uses
|
||||
System.SysUtils,
|
||||
DECCipherBase,
|
||||
DECCipherModes,
|
||||
DECCipherFormats,
|
||||
DECCiphers;
|
||||
|
||||
var
|
||||
Cipher : TCipher_1DES;
|
||||
// We use raw byte string here since Unicode handling of Windows console
|
||||
// is not given
|
||||
SourceText : RawByteString;
|
||||
// Key for the initialization of our encryption run
|
||||
CipherKey : RawByteString;
|
||||
IV : RawByteString;
|
||||
Input,
|
||||
Output : TBytes;
|
||||
i : Integer;
|
||||
begin
|
||||
Cipher := TCipher_1DES.Create;
|
||||
|
||||
try
|
||||
try
|
||||
// Init our encryption
|
||||
CipherKey := 'Passwort';
|
||||
IV := #0#0#0#0#0#0#0#0;
|
||||
Cipher.Init(CipherKey, IV, 0);
|
||||
Cipher.Mode := cmCBCx;
|
||||
|
||||
SourceText := 'Beispielklartext';
|
||||
WriteLn('Source text: ' + SourceText);
|
||||
Input := System.SysUtils.BytesOf(SourceText);
|
||||
|
||||
// Encrypt
|
||||
Output := Cipher.EncodeBytes(Input);
|
||||
|
||||
Write('Encrypted data in hex: ');
|
||||
for i := 0 to high(Output) do
|
||||
Write(IntToHex(Output[i], 2), ' ');
|
||||
|
||||
WriteLn;
|
||||
|
||||
// Decrypt
|
||||
Cipher.Init(CipherKey, IV, 0);
|
||||
Output := Cipher.DecodeBytes(Output);
|
||||
|
||||
SourceText := RawByteString(System.SysUtils.StringOf(Output));
|
||||
|
||||
WriteLn('Decrypted data: ' + SourceText);
|
||||
|
||||
// Show that using a different key results in a different output
|
||||
WriteLn;
|
||||
|
||||
CipherKey := 'Password';
|
||||
Cipher.Init(CipherKey, IV, 0);
|
||||
Output := Cipher.DecodeBytes(Output);
|
||||
|
||||
SourceText := RawByteString(System.SysUtils.StringOf(Output));
|
||||
|
||||
WriteLn('Decrypted with different key: ' + SourceText);
|
||||
|
||||
ReadLn;
|
||||
except
|
||||
on E: Exception do
|
||||
Writeln(E.ClassName, ': ', E.Message);
|
||||
end;
|
||||
finally
|
||||
Cipher.Free;
|
||||
end;
|
||||
end.
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0"?>
|
||||
<TgConfig Version="3" SubLevelDisabled="False" />
|
Reference in New Issue
Block a user