Ejemplo n.º 1
0
 public Config(string defaultPath, string password, CryptographicAlgorithmImpl crypto,
               SteganographicAlgorithmImpl stego)
 {
     DefaultPath = defaultPath;
     Password    = password;
     Crypto      = crypto;
     Stego       = stego;
 }
Ejemplo n.º 2
0
 public DocumentMessage(string path, bool compression = false, CryptographicAlgorithmImpl crypto = null,
                        string password = null)
     : base(path, compression, crypto, password)
 {
     if (!File.Exists(path))
     {
         throw new FileNotFoundException(path);
     }
 }
Ejemplo n.º 3
0
 protected SecretMessage(byte[] bytes, bool compression, CryptographicAlgorithmImpl crypto, string password)
 {
     if (bytes == null || bytes.Length <= 0)
     {
         throw new ArgumentNullException(nameof(bytes));
     }
     Bytes       = bytes;
     Compression = compression;
     Crypto      = crypto;
     mPassword   = password;
 }
Ejemplo n.º 4
0
 protected SecretMessage(string obj, bool compression, CryptographicAlgorithmImpl crypto, string password)
 {
     if (string.IsNullOrEmpty(obj))
     {
         throw new ArgumentNullException(nameof(obj));
     }
     mMessage    = obj;
     Compression = compression;
     Crypto      = crypto;
     mPassword   = password;
 }
Ejemplo n.º 5
0
        private string Encode(string src, string message, CryptographicAlgorithmImpl crypt = null,
                              string password = null, bool compression = false, int lsbIndicator = 3)
        {
            var model = new EncodeModel(src, message, crypt, password, Algorithm, compression, lsbIndicator);

            mStopwatch.Start();
            var result = model.Encode();

            mStopwatch.Stop();
            mEncryptionTime = mStopwatch.Elapsed;
            mStopwatch.Reset();
            return(result);
        }
Ejemplo n.º 6
0
        public DecodeModel(string imageSrc, CryptographicAlgorithmImpl crypto, string passsword,
                           SteganographicAlgorithmImpl stegano, bool compression, int lsbIndicator)
        {
            mSrcObj      = imageSrc;
            mCompression = compression;

            //Crypt
            CryptoAlgorithm = crypto;
            mPassword       = passsword;

            //Stegano
            SteganoAlgorithm = stegano;
            mLsbIndicator    = lsbIndicator;
        }
Ejemplo n.º 7
0
        public CryptionModel(string password, CryptographicAlgorithmImpl algorithm)
        {
            if (string.IsNullOrEmpty(password))
            {
                IsEnabled = false;
            }
            else
            {
                IsEnabled            = true;
                Password             = password;
                ConfirmationPassword = password;
            }

            Algorithm = algorithm ?? AlgorithmList.FirstOrDefault();
        }
Ejemplo n.º 8
0
        internal void Save(string password, CryptographicAlgorithmImpl selectedEncryptionMethod,
                           SteganographicAlgorithmImpl selectedSteganographicMethod,
                           string standardPath)
        {
            Password = password;
            SelectedEncryptionMethod     = selectedEncryptionMethod;
            SelectedSteganographicMethod = selectedSteganographicMethod;
            DefaultPath = standardPath;

            var config = new Config(DefaultPath, Password, SelectedEncryptionMethod, SelectedSteganographicMethod);
            var file   = Path.Combine(Constants.AppData, "Config.json");
            var sw     = new StreamWriter(File.Create(file));

            using (var writer = new JsonTextWriter(sw))
            {
                mSerializer.Serialize(writer, config);
            }
        }
Ejemplo n.º 9
0
 public TextMessage(string message, bool compression = false, CryptographicAlgorithmImpl crypto = null,
                    string password = null)
     : base(message, compression, crypto, password)
 {
 }
Ejemplo n.º 10
0
 public DocumentMessage(byte[] bytes, string extension, bool compression = false,
                        CryptographicAlgorithmImpl crypto = null, string password = null)
     : base(bytes, compression, crypto, password)
 {
     mExtension = extension;
 }