Skip to content

Commit 5c59beb

Browse files
committed
Initial commit
#1
1 parent e5b0a27 commit 5c59beb

11 files changed

+550
-2
lines changed

Plugins.ShaHashing.sln

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.12.35728.132 d17.12
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlowSynx.Plugins.ShaHashing", "src\FlowSynx.Plugins.ShaHashing.csproj", "{18678EC1-39EF-475D-82DE-A29E557E8559}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{18678EC1-39EF-475D-82DE-A29E557E8559}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{18678EC1-39EF-475D-82DE-A29E557E8559}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{18678EC1-39EF-475D-82DE-A29E557E8559}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{18678EC1-39EF-475D-82DE-A29E557E8559}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal

README.md

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,45 @@
1-
# plugin-sha-hashing
2-
SHA hashes for all SHA variants (SHA-1, SHA-2, SHA-3, and SHAKE) support for securing content or signatures.
1+
# FlowSynx SHA Hash Plugin – FlowSynx Platform Integration
2+
3+
The SHA Hash Plugin is a secure, plug-and-play component for the FlowSynx engine. It enables the computation of various SHA family hashes (including SHA-1, SHA-2, SHA-3, and SHAKE) from text or binary data, and is designed to seamlessly integrate into FlowSynx’s no-code/low-code automation workflows.
4+
5+
This plugin is automatically installed and managed by the FlowSynx engine when selected within the platform. It is not intended for standalone use or manual installation outside the FlowSynx environment.
6+
7+
---
8+
9+
## Purpose
10+
11+
This plugin allows FlowSynx users to generate cryptographic hash values using a range of SHA algorithms for input values as part of their workflow logic—without writing any code. Once activated, it becomes available as a utility function within the platform's workflow builder, supporting automation, validation, data integrity, and transformation scenarios.
12+
13+
---
14+
15+
## Supported Algorithms
16+
17+
The plugin supports the following hash algorithms:
18+
19+
- SHA-1
20+
- SHA-224
21+
- SHA-256
22+
- SHA-384
23+
- SHA-512
24+
- SHA-512/224
25+
- SHA-512/256
26+
- SHA3-224
27+
- SHA3-256
28+
- SHA3-384
29+
- SHA3-512
30+
- SHAKE128 (configurable output length)
31+
- SHAKE256 (configurable output length)
32+
33+
## Notes
34+
35+
- This plugin is supported exclusively within the FlowSynx platform.
36+
- It is installed automatically by the FlowSynx engine.
37+
- All hashing logic is securely executed within the FlowSynx runtime.
38+
- Plugin input (e.g., text, bytes, output length) is configured through FlowSynx-managed specifications.
39+
- SHAKE algorithms support customizable output lengths defined in the plugin specification.
40+
41+
---
42+
43+
## License
44+
45+
© FlowSynx. All rights reserved.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net9.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="BouncyCastle.Cryptography" Version="2.6.1" />
11+
<PackageReference Include="FlowSynx.PluginCore" Version="1.3.0" />
12+
</ItemGroup>
13+
14+
<ItemGroup>
15+
<Compile Update="Resources.Designer.cs">
16+
<DesignTime>True</DesignTime>
17+
<AutoGen>True</AutoGen>
18+
<DependentUpon>Resources.resx</DependentUpon>
19+
</Compile>
20+
</ItemGroup>
21+
22+
<ItemGroup>
23+
<EmbeddedResource Update="Resources.resx">
24+
<Generator>ResXFileCodeGenerator</Generator>
25+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
26+
</EmbeddedResource>
27+
</ItemGroup>
28+
29+
<ItemGroup>
30+
<None Update="flowsynx.png">
31+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
32+
</None>
33+
<None Update="README.md">
34+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
35+
</None>
36+
</ItemGroup>
37+
38+
</Project>

src/HashHelper.cs

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
using Org.BouncyCastle.Crypto.Digests;
2+
using Org.BouncyCastle.Crypto;
3+
4+
namespace FlowSynx.Plugins.ShaHashing;
5+
6+
internal static class HashHelper
7+
{
8+
public static byte[] SHA1(byte[] input) => System.Security.Cryptography.SHA1.HashData(input);
9+
public static byte[] SHA256(byte[] input) => System.Security.Cryptography.SHA256.HashData(input);
10+
public static byte[] SHA384(byte[] input) => System.Security.Cryptography.SHA384.HashData(input);
11+
public static byte[] SHA512(byte[] input) => System.Security.Cryptography.SHA512.HashData(input);
12+
13+
public static byte[] SHA3_256(byte[] input) => System.Security.Cryptography.SHA3_256.HashData(input);
14+
public static byte[] SHA3_384(byte[] input) => System.Security.Cryptography.SHA3_384.HashData(input);
15+
public static byte[] SHA3_512(byte[] input) => System.Security.Cryptography.SHA3_512.HashData(input);
16+
17+
public static byte[] SHA224(byte[] input)
18+
{
19+
var digest = new Sha224Digest();
20+
return ComputeDigest(digest, input);
21+
}
22+
23+
public static byte[] SHA512_224(byte[] input)
24+
{
25+
var digest = new Sha512tDigest(224);
26+
return ComputeDigest(digest, input);
27+
}
28+
29+
public static byte[] SHA512_256(byte[] input)
30+
{
31+
var digest = new Sha512tDigest(256);
32+
return ComputeDigest(digest, input);
33+
}
34+
35+
public static byte[] SHA3_224(byte[] input)
36+
{
37+
var digest = new Sha3Digest(224);
38+
return ComputeDigest(digest, input);
39+
}
40+
41+
public static byte[] SHAKE128(byte[] input, int outputLength)
42+
{
43+
var digest = new ShakeDigest(128);
44+
return ComputeXofDigest(digest, input, outputLength);
45+
}
46+
47+
public static byte[] SHAKE256(byte[] input, int outputLength)
48+
{
49+
var digest = new ShakeDigest(256);
50+
return ComputeXofDigest(digest, input, outputLength);
51+
}
52+
53+
private static byte[] ComputeDigest(IDigest digest, byte[] input)
54+
{
55+
digest.BlockUpdate(input, 0, input.Length);
56+
var result = new byte[digest.GetDigestSize()];
57+
digest.DoFinal(result, 0);
58+
return result;
59+
}
60+
61+
private static byte[] ComputeXofDigest(IXof xof, byte[] input, int outputLength)
62+
{
63+
xof.BlockUpdate(input, 0, input.Length);
64+
var result = new byte[outputLength];
65+
xof.OutputFinal(result, 0, outputLength);
66+
return result;
67+
}
68+
}

src/Models/InputParameter.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace FlowSynx.Plugins.ShaHashing.Models;
2+
3+
internal class InputParameter
4+
{
5+
public string Algorithm { get; set; } = "sha256";
6+
public string? InputText { get; set; }
7+
public byte[]? InputBytes { get; set; }
8+
public int? OutputLength { get; set; } // Only for SHAKE
9+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using FlowSynx.PluginCore;
2+
3+
namespace FlowSynx.Plugins.ShaHashing.Models;
4+
5+
internal class ShaHashingPluginSpecifications: PluginSpecifications
6+
{
7+
8+
}

src/README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
## FlowSynx SHA Hash Plugin – FlowSynx Platform Integration
2+
3+
The SHA Hash Plugin is a secure, plug-and-play component for the FlowSynx engine. It enables the computation of various SHA family hashes (including SHA-1, SHA-2, SHA-3, and SHAKE) from text or binary data, and is designed to seamlessly integrate into FlowSynx’s no-code/low-code automation workflows.
4+
5+
This plugin is automatically installed and managed by the FlowSynx engine when selected within the platform. It is not intended for standalone use or manual installation outside the FlowSynx environment.
6+
7+
---
8+
9+
## Purpose
10+
11+
This plugin allows FlowSynx users to generate cryptographic hash values using a range of SHA algorithms for input values as part of their workflow logic—without writing any code. Once activated, it becomes available as a utility function within the platform's workflow builder, supporting automation, validation, data integrity, and transformation scenarios.
12+
13+
---
14+
15+
## Supported Algorithms
16+
17+
The plugin supports the following hash algorithms:
18+
19+
- SHA-1
20+
- SHA-224
21+
- SHA-256
22+
- SHA-384
23+
- SHA-512
24+
- SHA-512/224
25+
- SHA-512/256
26+
- SHA3-224
27+
- SHA3-256
28+
- SHA3-384
29+
- SHA3-512
30+
- SHAKE128 (configurable output length)
31+
- SHAKE256 (configurable output length)
32+
33+
## Notes
34+
35+
- This plugin is supported exclusively within the FlowSynx platform.
36+
- It is installed automatically by the FlowSynx engine.
37+
- All hashing logic is securely executed within the FlowSynx runtime.
38+
- Plugin input (e.g., text, bytes, output length) is configured through FlowSynx-managed specifications.
39+
- SHAKE algorithms support customizable output lengths defined in the plugin specification.
40+
41+
---
42+
43+
## License
44+
45+
© FlowSynx. All rights reserved.

src/Resources.Designer.cs

Lines changed: 81 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)