Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7837363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T14:36:34+00:00 2026-06-02T14:36:34+00:00

I want to write a simple automated test to determine if a .ts video

  • 0

I want to write a simple automated test to determine if a .ts video file has been encrypted using AES 128 encryption. I will have access to both the encrypted and unencrypted files. I will also have access to the key. I will pretty much have access to everything because I am working with the developers doing the encryption 🙂

I’d prefer to do a test more advanced than just checking to see if the file sizes are different.

Any thoughts on some simple test code I could write? I’d be writing the code with c# or powershell.

I have absolutely no experience with this stuff so feel free to treat me like a child.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T14:36:36+00:00Added an answer on June 2, 2026 at 2:36 pm

    I eventually made a c# command line.

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    
    namespace ConsoleApplication2
    {
        using System.IO;
        using System.Security.Cryptography;
    
        class Program
        {
            static void Main(string[] args)
            {
    
                if (args.Length == 0)
                {
                    Console.WriteLine("<key> <iv> <encryptedfile> <outputdecryptedfile>");
                    Environment.Exit(-1);
                }
    
                //Console.ReadLine();
                byte[] encryptionKey = StringToByteArray(args[0]);
                byte[] encryptionIV = StringToByteArray(args[1]);
    
                try
                {
                    using (FileStream outputFileStream = new FileStream(args[3], FileMode.CreateNew))
                    {
                        using (FileStream inputFileStream = new FileStream(args[2], FileMode.Open))
                        {
                            using (var aes = new AesManaged { Key = encryptionKey, IV = encryptionIV, Mode = CipherMode.CBC })
                            using (var encryptor = aes.CreateDecryptor())
                           using (var cryptoStream = new CryptoStream(inputFileStream, encryptor, CryptoStreamMode.Read))
                            {
                                cryptoStream.CopyTo(outputFileStream);
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.ToString());
                }            
            }
    
            public static byte[] StringToByteArray(string hex)
            {
                return Enumerable.Range(0, hex.Length)
                                 .Where(x => x % 2 == 0)
                                 .Select(x => Convert.ToByte(hex.Substring(x, 2), 16))
                                 .ToArray();
            }
    
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to write a simple web framework myself using WSGI, Python. I am
I want to write a simple program that takes a moderately sized wav file
I want to write simple application in C++ using ctime library. I'm getting the
I want to write a simple program, that writes console input to file with
I want to write two simple utilities: Receives a Binary file, and converts it
I want to write a simple HTMLUnit test script for Jenkins (former Hudson). INFO:
I want to write simple script to copy/backup directory then remove on server startup.
I want to write a simple chat-client in Ruby for the terminal. The Problem
I want to write a simple DSL in C#. Nothing too complicated. I'm looking
I want to write a simple web proxy, for exercise. Here's the code I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.