Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. how to read a encrypted html? need help

how to read a encrypted html? need help

Scheduled Pinned Locked Moved C#
securitycsharphtmllinqperformance
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    YiXiang_89
    wrote on last edited by
    #1

    Hi everyone, i need your help This is my sym.cs file where it store the encryption part using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; using System.Security.Cryptography; namespace SecurePDFViewer { public class SymCrypto { private SymmetricAlgorithm symAlgorithm; private static byte[] saltValue = new byte[] {213,230,110,217,191,69,82,238}; private static byte[] IV = new byte[] { 207, 177, 154, 229, 191, 104, 44, 244, 86, 12, 63, 54, 94, 9, 88, 148 }; private static int keySize = 256; private static int pwIteration = 7; public SymCrypto() { //Creates the default implementation, which is RijndaelManaged 256 bits symAlgorithm = SymmetricAlgorithm.Create(); symAlgorithm.IV = IV; } public SymCrypto(string algorithmName) { symAlgorithm = SymmetricAlgorithm.Create(algorithmName); symAlgorithm.KeySize = keySize; symAlgorithm.IV = IV; } public byte[] EncryptData(string passphrase, byte[] plainBytes) { GenerateKey(passphrase); // Define memory stream which will be used to hold encrypted data MemoryStream memoryStream = new MemoryStream(); // Define cryptographic stream (Write mode for encryption) CryptoStream cryptoStream = new CryptoStream(memoryStream, symAlgorithm.CreateEncryptor(), CryptoStreamMode.Write); cryptoStream.Write(plainBytes, 0, plainBytes.Length); cryptoStream.FlushFinalBlock(); byte[] cipherBytes = memoryStream.ToArray(); // Close streams memoryStream.Close(); cryptoStream.Close(); return cipherBytes; } public string EncryptData(string passphrase, string plainText) { byte[] plainTextBytes = Encoding.UTF8.GetBytes(plainText); return Convert.ToBase64String(EncryptData(passphrase, plainTextBytes)); } public byte[] DecryptData(string passphrase, byte[] cipherBytes) { GenerateKey(passphrase); // Define memory stream which will be used to hold encrypted data MemoryStream memoryStream = new MemoryStream(cipherBytes);

    C 1 Reply Last reply
    0
    • Y YiXiang_89

      Hi everyone, i need your help This is my sym.cs file where it store the encryption part using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; using System.Security.Cryptography; namespace SecurePDFViewer { public class SymCrypto { private SymmetricAlgorithm symAlgorithm; private static byte[] saltValue = new byte[] {213,230,110,217,191,69,82,238}; private static byte[] IV = new byte[] { 207, 177, 154, 229, 191, 104, 44, 244, 86, 12, 63, 54, 94, 9, 88, 148 }; private static int keySize = 256; private static int pwIteration = 7; public SymCrypto() { //Creates the default implementation, which is RijndaelManaged 256 bits symAlgorithm = SymmetricAlgorithm.Create(); symAlgorithm.IV = IV; } public SymCrypto(string algorithmName) { symAlgorithm = SymmetricAlgorithm.Create(algorithmName); symAlgorithm.KeySize = keySize; symAlgorithm.IV = IV; } public byte[] EncryptData(string passphrase, byte[] plainBytes) { GenerateKey(passphrase); // Define memory stream which will be used to hold encrypted data MemoryStream memoryStream = new MemoryStream(); // Define cryptographic stream (Write mode for encryption) CryptoStream cryptoStream = new CryptoStream(memoryStream, symAlgorithm.CreateEncryptor(), CryptoStreamMode.Write); cryptoStream.Write(plainBytes, 0, plainBytes.Length); cryptoStream.FlushFinalBlock(); byte[] cipherBytes = memoryStream.ToArray(); // Close streams memoryStream.Close(); cryptoStream.Close(); return cipherBytes; } public string EncryptData(string passphrase, string plainText) { byte[] plainTextBytes = Encoding.UTF8.GetBytes(plainText); return Convert.ToBase64String(EncryptData(passphrase, plainTextBytes)); } public byte[] DecryptData(string passphrase, byte[] cipherBytes) { GenerateKey(passphrase); // Define memory stream which will be used to hold encrypted data MemoryStream memoryStream = new MemoryStream(cipherBytes);

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      We didn't need to see all this code. So, you're saying you can decrypt it, but you want to display it in IE via a toolbar ? So, you want to intercept an HTTP request and decode it, right ? Does it have to be in a toolbar, could it be in an app that contains an IE control and then does the HTTP request ?

      Christian Graus Driven to the arms of OSX by Vista.

      Y 2 Replies Last reply
      0
      • C Christian Graus

        We didn't need to see all this code. So, you're saying you can decrypt it, but you want to display it in IE via a toolbar ? So, you want to intercept an HTTP request and decode it, right ? Does it have to be in a toolbar, could it be in an app that contains an IE control and then does the HTTP request ?

        Christian Graus Driven to the arms of OSX by Vista.

        Y Offline
        Y Offline
        YiXiang_89
        wrote on last edited by
        #3

        No, Cause that encrypt words is hardcoded How can i do like this: Use getElementsByName() if my var x=document.getElementsByName("encrypt"); How can i capture those encrypt in the html and ancrypt it?

        text"

        text

        1 Reply Last reply
        0
        • C Christian Graus

          We didn't need to see all this code. So, you're saying you can decrypt it, but you want to display it in IE via a toolbar ? So, you want to intercept an HTTP request and decode it, right ? Does it have to be in a toolbar, could it be in an app that contains an IE control and then does the HTTP request ?

          Christian Graus Driven to the arms of OSX by Vista.

          Y Offline
          Y Offline
          YiXiang_89
          wrote on last edited by
          #4

          No, Cause this encrypt is hardcode How can i do like this: Use getElementsByName() if my var x=document.getElementsByName("encrypt"); How can i capture those encrypt in the html and ancrypt it?

          text"

          text

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups