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

  • SEARCH
  • Home
  • 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 732033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:05:44+00:00 2026-05-14T07:05:44+00:00

I’m trying out the Rijndael to generate an encrypted license string to use for

  • 0

I’m trying out the Rijndael to generate an encrypted license string to use for our new software, so we know that our customers are using the same amount of apps that they paid for. I’m doing two things:

  1. Getting the users computer name.

  2. Adding a random number between 100 and 1000000000

I then combine the two, and use that as the license number(This probably will change in the final version, but I’m just doing something simple for demonstration purposes).

Here is some sample codez:

 Private Sub Main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim generator As New Random
    Dim randomValue As Integer
    randomValue = generator.Next(100, 1000000000)


    ' Create a new Rijndael object to generate a key
    ' and initialization vector (IV).
    Dim RijndaelAlg As Rijndael = Rijndael.Create

    ' Create a string to encrypt.
    Dim sData As String = My.Computer.Name.ToString + randomValue.ToString
    Dim FileName As String = "C:\key.txt"

    ' Encrypt text to a file using the file name, key, and IV.
    EncryptTextToFile(sData, FileName, RijndaelAlg.Key, RijndaelAlg.IV)

    ' Decrypt the text from a file using the file name, key, and IV.
    Dim Final As String = DecryptTextFromFile(FileName, RijndaelAlg.Key, RijndaelAlg.IV)

    txtDecrypted.Text = Final


End Sub

That’s my load event, but here is where the magic happens:

Sub EncryptTextToFile(ByVal Data As String, ByVal FileName As String, ByVal Key() As Byte, ByVal IV() As Byte)

    Dim fStream As FileStream = File.Open(FileName, FileMode.OpenOrCreate)
    Dim RijndaelAlg As Rijndael = Rijndael.Create
    Dim cStream As New CryptoStream(fStream, _
                                   RijndaelAlg.CreateEncryptor(Key, IV), _
                                   CryptoStreamMode.Write)
    Dim sWriter As New StreamWriter(cStream)

    sWriter.WriteLine(Data)
    sWriter.Close()
    cStream.Close()
    fStream.Close()



End Sub

There is a couple things I don’t understand. What if someone reads the text file and recognizes that it is Rijndael, and writes a VB or C# app that decrypts it? I don’t really understand all of this code, so if you guys can help me out I will love you all forever.

Thanks in advance

  • 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-05-14T07:05:44+00:00Added an answer on May 14, 2026 at 7:05 am

    You have stumbled on a very basic problem: It’s easy enough to encrypt some data, but how do you transfer the key?

    You can take a look at asymmetric encryption (RSA), you could add a signature similar to that of signed assemblies.

    A very top-level description:

    1. You generate a key-pair (public and private key) 1 time. Keep the private key secret.
    2. You get UserName, Hash it and encrypt the hash with the Private key.
    3. You send encrypted hash (signature) to the customer as part of your license file.
    4. Your program uses (embedded) public key to decode signature
    5. Your program hashes local Username and compares with decoded version.
    6. Your program decides if it licensed or not and acts accordingly.

    The hashing is used to limit the number of bytes to encrypt. For Username you can substitute any data you need (ie Username + EndDate).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know there's a lot of other questions out there that deal with this
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to create an if statement in PHP that prevents a single post

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.