HS-HASH is a data hashing class that uses a secure hash algorithm and returns the hashed value of the entered string. For security reasons, you may want to store passwords in hashed form. This guards against the possibility that someone who gains unauthorized access to the database can retrieve the passwords of every user in the system. Hashing performs a one-way transformation on a password, turning the password into another String, called the hashed password. “One-way” means that it is practically impossible to go the other way - to turn the hashed password back into the original password.
Features:
HASH Hash1 = new HASH();
private void Button_Click(object sender, RoutedEventArgs e)
{
// Hash options
// string hash = Hash1.Get_MD5_Hash(tbStringToHash.Text);
// string hash = Hash1.Get_SHA1_Hash(tbStringToHash.Text);
// string hash = Hash1.Get_SHA256_Hash(tbStringToHash.Text);
// string hash = Hash1.Get_SHA384_Hash(tbStringToHash.Text);
string hash = Hash1.Get_SHA512_Hash(tbStringToHash.Text);
tbHash.Text = hash;
}
private void Button_Click_1(object sender, RoutedEventArgs e)
{
// Verify hash options
// Hash1.Verify_MD5_Hash(tbStringToHash.Text, tbHash.Text)
// Hash1.Verify_SHA1_Hash(tbStringToHash.Text, tbHash.Text)
// Hash1.Verify_SHA256_Hash(tbStringToHash.Text, tbHash.Text)
// Hash1.Verify_SHA384_Hash(tbStringToHash.Text, tbHash.Text)
// Hash1.Verify_SHA512_Hash(tbStringToHash.Text, tbHash.Text)
// Verify the hash
if (Hash1.Verify_SHA512_Hash(tbStringToHash.Text, tbHash.Text) == true)
{
MessageBox.Show("Good Password");
}
else
{
MessageBox.Show("Bad Password");
}
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
//Hash1.UseLowercaseHash = true;
//Hash1.RemoveSalt = true;
//Hash1.AddSpaceToHex = true;
}
private void cbSalt_Click(object sender, RoutedEventArgs e)
{
if (cbSalt.IsChecked == true)
{
Hash1.RemoveSalt = true;
}
else
{
Hash1.RemoveSalt = false;
}
}
private void btnKeyGen_Click(object sender, RoutedEventArgs e)
{
//Generate a random cryptographic key using the RNGCryptoServiceProvider
tbHash.Text = Hash1.GenerateRandomCryptographicKey();
//Use this to generate a random string using Random rnd = new Random(). NOTE: It is not recommended to use this for passwords.
//Hash1.RND_Characters = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.!-_|#*";
//tbStringToHash.Text = Hash1.GenerateRandomString();
}
private void btnhex_Click(object sender, RoutedEventArgs e)
{
tbHash.Text = Hash1.EncodeHexString(tbStringToHash.Text);
}
private void btnDecodeHex_Click(object sender, RoutedEventArgs e)
{
tbHash.Text = Hash1.DecodeHexString(tbHash.Text);
}
private void btnStringToBinary_Click(object sender, RoutedEventArgs e)
{
tbHash.Text = Hash1.StringToBinary(tbStringToHash.Text);
}
private void btnBinaryToString_Click(object sender, RoutedEventArgs e)
{
tbHash.Text = Hash1.BinaryToString(tbHash.Text);
}
private void Button_Click_2(object sender, RoutedEventArgs e)
{
tbHash.Text = Hash1.GeneratorSoftwareKey(tbStringToHash.Text);
}
private void Button_Click_3(object sender, RoutedEventArgs e)
{
// Verify software key
if (Hash1.VerifySoftwareKey(tbStringToHash.Text, tbHash.Text) == true)
{
MessageBox.Show("Good Software Key");
}
else
{
MessageBox.Show("Bad Software Key");
}
}
byte[] encrypted;
private void btnEncrypt_Click(object sender, RoutedEventArgs e)
{
using (AesCryptoServiceProvider myAes = new AesCryptoServiceProvider())
{
// Encrypt the string to an array of bytes.
encrypted = Hash1.EncryptStringToBytes_Aes(tbStringToHash.Text, myAes.Key, myAes.IV);
tbHash.Text = "Encrypted: " + Encoding.UTF8.GetString(encrypted);
// Decrypt the bytes to a string.
string roundtrip = Hash1.DecryptStringFromBytes_Aes(encrypted, myAes.Key, myAes.IV);
tbHash.Text += "\rRoundtrip: " + roundtrip;
}
}
private void btnRijndaelEncrypt_Click(object sender, RoutedEventArgs e)
{
using (AesCryptoServiceProvider myAes = new AesCryptoServiceProvider())
{
// Encrypt the string to an array of bytes.
encrypted = Hash1.RijndaelEncryptStringToBytes(tbStringToHash.Text, myAes.Key, myAes.IV);
tbHash.Text = "Encrypted: " + Encoding.UTF8.GetString(encrypted);
// Decrypt the bytes to a string.
string roundtrip = Hash1.RijndaelDecryptStringFromBytes(encrypted, myAes.Key, myAes.IV);
tbHash.Text += "\rRoundtrip: " + roundtrip;
}
}
Version: 1.1.1
.Net Standard 2.1
HS MarkerBar and BarChart is a Visual Studio progress-bar I built for an irrigation district SCADA system. the progress-bar needed to show high/low water values in a canal system. I also add a simple bar-chart control as well.
Dim Value As Double = 0
Private Sub S1_ValueChanged(sender As Object, e As RoutedPropertyChangedEventArgs(Of Double)) Handles S1.ValueChanged
Value = S1.Value
Bar()
End Sub
Private Sub Bar()
Try
'Value Settings
B1.Maximum = 100
B1.Minimum = 0
'Set marker values
B1.BarMarker1Value = 75
B1.BarMarker2Value = 50
B1.BarMarker3Value = 30
B1.BarMarker4Value = 20
'Show/Add text value to bar
B1.ShowText(FormatNumber(Value, 0))
B2.ShowText(FormatNumber(Value, 2))
B3.ShowText(FormatNumber(Value, 0))
B4.ShowText(FormatNumber(Value, 2))
B5.ShowText(FormatNumber(Value, 0))
B6.ShowText(FormatNumber(Value, 2))
B7.ShowText(FormatNumber(Value, 0))
B8.ShowText(FormatNumber(Value, 0))
'Set bar value
B1.Value = Value
B2.Value = Value
B3.Value = Value
B4.Value = Value
B5.Value = Value
B6.Value = Value
B7.Value = Value
B8.Value = Value
tb1.Text = S1.Value
Catch ex As Exception
MsgBox(ex.ToString, MsgBoxStyle.Critical)
End Try
End Sub
Private Sub Button_Click(sender As Object, e As RoutedEventArgs)
'This will open a Save file dialog
B8.SaveAsBMPFileDialog()
'This one You will need to provide the path and filename EX: Image.bmp or C:\Image.bmp
'B8.SaveAsBMP("Image.bmp")
End Sub
Private Sub Button_Click_1(sender As Object, e As RoutedEventArgs)
B1.Print()
End Sub
Private Sub Button_Click_2(sender As Object, e As RoutedEventArgs)
B1.RemoveTextValue()
End Sub
Private Sub Button_Click_3(sender As Object, e As RoutedEventArgs)
Dim C1 As New Chart
C1.Show()
End Sub
Version: 1.5.7
.Net 4.7.2
The goal of this WPF progress bar control is to provide a simple and good-looking control that also shows the text value of the progress bar. This progress bar is designed to run on Desktop (WPF) applications using .Net Frameworks 4.7.2
Features
Class MainWindow
Dim SetMin As Double = 0.0
Dim SetMax As Double = 100.0
Private Sub Window_Loaded(sender As Object, e As RoutedEventArgs)
B1.Minimum = SetMin
B1.Maximum = SetMax
B1.BarShowBorder = True
B1.BarOrientation = HSProgressBar.HSPB.Orient.Vertical
B1.BarDirection = HSProgressBar.HSPB.Direction.Normal
B1.BarShowText = True
B1.BarTextDecimalPlace = 0
B1.BarShowTextPercentage = True
'Settings to run a continuous progress bar
B1.BarContinuousSpeed = 10
B1.BarContinuousStep = 1
'B1.BarContinuousBackAndForth = True
'B1.BarRunBackwards = True
B1.StartContinuous()
'B1.StopContinuous()
slider.Minimum = SetMin
slider.Maximum = SetMax
End Sub
Private Sub slider_ValueChanged(sender As Object, e As RoutedPropertyChangedEventArgs(Of Double)) Handles slider.ValueChanged
B1.Value = slider.Value
B2.Value = slider.Value
B3.Value = slider.Value
B4.Value = slider.Value
End Sub
End Class
Version: 1.5.7
.Net 4.7.2
ALL SOFTWARE ON THIS PAGE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
If you are feeling generous and would like to help support our free software please click the button below to donate. Donate