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 7686331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:27:19+00:00 2026-05-31T19:27:19+00:00

is there anyway that I can convert this to use RSA encryption? im kinda

  • 0

is there anyway that I can convert this to use RSA encryption? im kinda new to VB.Net and even worse at encryption. thanks

Imports System.Text
Imports System.Security.Cryptography
Imports System.IO
Public Class ClsEncryption
Public Shared Function DESEncrypt(ByVal Data As String, ByVal Key As String) As String
    Dim DES As New System.Security.Cryptography.DESCryptoServiceProvider
    Dim dHash As New System.Security.Cryptography.MD5CryptoServiceProvider
    Dim encrypted As String = ""
    Try
        Dim hash(7) As Byte
        Dim temp As Byte() = dHash.ComputeHash(System.Text.ASCIIEncoding.ASCII.GetBytes(Key))
        Array.Copy(temp, 0, hash, 0, 8)
        DES.Key = hash
        DES.Mode = Security.Cryptography.CipherMode.ECB
        Dim DESEncrypter As System.Security.Cryptography.ICryptoTransform = DES.CreateEncryptor
        Dim Buffer As Byte() = System.Text.ASCIIEncoding.ASCII.GetBytes(Data)
        encrypted = Convert.ToBase64String(DESEncrypter.TransformFinalBlock(Buffer, 0, Buffer.Length))
        Return encrypted
    Catch ex As Exception
    End Try
End Function
End Class
  • 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-31T19:27:20+00:00Added an answer on May 31, 2026 at 7:27 pm

    For encryption you could pass the (trusted) public key instead of the DES key to the function. You could keep the encryption the same as the it is now, but instead of using the now replaced DES key, you should generate this key using a random number generator. Then you can encrypt the DES key using PKCS#1 v1.5 padding. Finally, you require some kind of container format to send the encrypted DES key and the ciphertext.

    To decrypt, use the private key of the asymmetric key pair to decrypt the DES key, and then perform the decryption of the plain text as it is now.

    Note that you should use an IV, should not use DES or ECB mode encryption, ASCII is better replaced by UTF-8 etc. etc. If this is for a project of any importance, ask for expert help. If possible, find out a library function to do all this for you, e.g. something that creates PKCS#7/CMS EncryptedData structures.

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

Sidebar

Related Questions

is there anyway that I can convert a png to a bmp in C#?
Is there any way I can set a formatter on models that will convert
Is there anyway that we can detect when the system/screen gets locked and notify
Is there anyway that I can hook into the tab completion for bash from
Is there anyway or any addin for VS2010 that can remove all the comments
Is there anyway to determine the Exceptions that can be thrown by methods in
Is there anyway I can build a Select statement that uses the Contains function?
Is there anyway I can convert my ttf fonts to PostScript Type 1 (pt1)
Is there any way that you can detect the resizeHandlers moment of completion? something
Is there any way that we can print the user name of the person

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.