Skip to content

Instantly share code, notes, and snippets.

View cosmasokoth's full-sized avatar
💭
1%

Cosmas Okoth cosmasokoth

💭
1%
View GitHub Profile
@sajidmohammed88
sajidmohammed88 / 1 - Encryption-Decryption-boucy-castle-C#.md
Last active December 23, 2024 06:06
Encryption/Decryption by BouncyCastle nuget for .NET projects.
@sajidmohammed88
sajidmohammed88 / BitBucket API Cloud-c#.md
Last active September 6, 2022 11:21
Get repos details from API cloud bitbucket.
public async Task<string> UploadFile(string filePath)
{
_logger.LogInformation($"Uploading a text file [{filePath}].");
if (string.IsNullOrWhiteSpace(filePath))
{
throw new ArgumentNullException(nameof(filePath));
}
if (!File.Exists(filePath))
{
@tarzak
tarzak / is_installed.sh
Created February 16, 2017 17:15 — forked from JamieMason/is_installed.sh
Check if a program exists from a bash script. Thanks to twitter.com/joshnesbitt and twitter.com/mheap for the help with detecting npm packages.
#!/bin/bash
# Functions ==============================================
# return 1 if global command line program installed, else 0
# example
# echo "node: $(program_is_installed node)"
function program_is_installed {
# set to 1 initially
local return_=1
// Here you can find full description: https://thetial.com/rsa-encryption-and-decryption-net-core/
using System;
using System.IO;
using System.Text;
using System.Collections.Generic;
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Crypto.Encodings;
using Org.BouncyCastle.Crypto.Engines;
using Org.BouncyCastle.OpenSsl;
@ozziest
ozziest / StringCipher.cs
Created January 4, 2016 09:50
Simple data encryption and decryption class in C#
public static class StringCipher
{
public static string Encrypt(string toEncrypt, bool useHashing, string key = "my_token")
{
byte[] keyArray;
byte[] toEncryptArray = UTF8Encoding.UTF8.GetBytes(toEncrypt);
System.Configuration.AppSettingsReader settingsReader = new AppSettingsReader();
//System.Windows.Forms.MessageBox.Show(key);