VS 2010 Getting The AES-256-CBC Encryption?
Apr 19, 2012
i have in php two functions, one to encrypt and one to decrypt.
PHP
function Encrypt($message) {$Method = "AES-256-CBC";$passPhrase = "key";$iVector = 1234567890123456;$encryptedMessage = openssl_encrypt($message, $Method, $passPhrase, $iVector);return $encryptedMessage;}function Decrypt($message) {$Method = "AES-256-CBC";$passPhrase = "key";$iVector = 1234567890123456;$decryptedMessage = openssl_decrypt($message, $Method, $passPhrase, $iVector);return $decryptedMessage;}
what i want to do, is encrypt a message, using the same method in vb.net as i do in php, how would i go about doing this?
View 4 Replies
ADVERTISEMENT
Apr 5, 2012
Looking to make my program FIPS 140-2 compliant and found this project code in vb:[code...]
It converts to VS2010 just fine so, thought I'd try to use it as a starting place. The problem right now is that the key is in the executable, I know it's just a sample but can't figure out how to hide the key. So, thought I could take the user who is logged onto the computer and use a hash of their password as the key, and don't store it anywhere or better put it in a public encrypted variable (not sure about this part either). Anyway, getting stuck on this part and can't continue testing, looks like a conversion error:[code....]
I want to encrypt various credentials stored in my.settings and a few other files but using a hash of a users password but not stored on the computer. I might be a little fuzzy on the whole idea of being FIPS 140 compliant. Looks like I need to probably use AES and a non stored key somehow.
Right now my program loads a first form that loads up two text boxes username and password. If the (decrypted) password that gets typed in matches what the (decrypted) value of my.settings.password then it will continue to load the next form. The encryption is not currently AES and the password key is stored in the .exe. So, I'm trying to change that.
View 1 Replies
Oct 6, 2011
I am using the code from the following link. Basically I am using the built in functions in visual basic for encryption (Cryptography). Seeing as there is a lot of code for it, I posted a link to the code I am using.
[URL]
I get what this is doing and how it is doing it...for the most part. My question is how do you let the user set the key to be used instead of it randomly generating one? One of the reasons I want this over the random key is that the user will be able to remember it easier and the key generated sometimes has weird characters in it that not everyone will no how to use. I have tried everything I can think of.
The encryption works good, all I am using it for is to encrypt/decrypt a text document. If this is not too good of an encryption, that does not matter as I am not using it to encrypt any highly sensitive information. All I need is a way to be able to allow the user to set the key, but every time I try to pass a string through the encryption() method instead of a generated key (in the generateKey() method) it will give me an error.
View 2 Replies
Jan 25, 2012
I tried to follow this method from microsoft i added the whole code to a module and tried to call EncryptFile in a form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
EncryptFile("C: est his.txt", "C: est his2.txt", "nothing todohere")
MsgBox("tada!")
End Sub
However I got this error message Error "Specified key is not a valid size for this algorithm."in
DES.Key = ASCIIEncoding.ASCII.GetBytes(sKey)
the this.txt contains only the text whatitdo btw, can this process handle large text files? about 100KB?
View 1 Replies
Jun 22, 2011
I have (using some examples) created a program which reads from a file, encrypts the content and writes it to a new file. The file can then be reopened in the program and decrypted.Now I am trying to adapt the program to split the file into pieces as specified by the user whilst it is been written to the hard drive. This also works, but when the files are read and decrypted the original file seems to be corrupted. I have been testing it using a JPG which turns out viewable, but is distorted. However the filesize is the same as the orignal after the encryption/decryption process. [code]
View 3 Replies
Jun 21, 2011
I have set up a method in vb.net and in xcode for encrypting a string using as far as i can tell the same parameters for an AES encryption.I've looked all over the place but cannot find information on whether they use the same encryption algorithm and settings.
this is the vb.net code:
Dim encryptAES As New AesCryptoServiceProvider()
Dim encoding As New UTF8Encoding()
Dim encryptor As ICryptoTransform
encryptAES.Key = encoding.GetBytes("12345678901234567890123456789032")
encryptAES.IV = encoding.GetBytes("1234567890123416")
encryptAES.Mode = CipherMode.CBC
[Code]...
View 1 Replies
Apr 22, 2011
I recently made a simple pseudo-encryption program that changes each character into another. It is capable of encrypting and decrypting a string. This can also be done to any text file as well. The characters range from ASCII 32-254 (This on it's own may be an issue because of #127 being DEL).
Because I believed my own coding may be at fault, I attempted this with Triple Des with identical results.For Triple Des, the requirements for en/decryption was:
Encrypt: String to Byte
Decrypt: Byte to String
And to change them either direction, I used UTF8. I also attempted ASCII and UTF32, but I don't know what I should do. I am considering dropping this but I want to learn problems like this because I am currently in college and haven't started my core classes for programming yet and want the head start.
The point where I have come into a problem is attempting to do this to another file type like an image. I looked at the results from encrypting then decrypting and the results were similar, but it seems file encoding must be the culprit.
View 3 Replies
Mar 25, 2012
is there anyway that I can convert this to use RSA encryption?
Imports System.Text
Imports System.Security.Cryptography
Imports System.IO
Public Class ClsEncryption
[code].....
View 1 Replies
Jan 28, 2011
I have been trying to create an app that will do xor encryption. I have tried a few different functions but none of them seem to give me what I want. I need it to put the coded text into a 7 bit ascii string. For example if the key was a - 1100001 and the text to be encrypted was s - 1110011 then it would return 0010010 as the encryption. One of the pieces of code I tried to use
Public Function XOREncryption(ByVal CodeKey As String, ByVal DataIn As String) As String
Dim lonDataPtr As Long
Dim strDataOut As String
Dim temp As Integer
[code]....
This returns a hex digit though which will not work for what I want.
View 4 Replies
Sep 3, 2009
have made a library for my vb.net project by combining 3 libraries (using ilmerge).
View 3 Replies
Nov 15, 2011
I am attempting to create a program that can do raw RSA encryption (performing the encryption without using 'Encrypt' and 'Decrypt') of a user's message that can contain a-z, A-Z, 0-9, and [,.;:'"()]. I've attached a screen shot of the application form.
Basically, the user will pick from a list of prime numbers from the first box and input them into p and q. They will type their message in the designated textbox and then hit <encrypt> which will encrypt using p and q and then show the encrypted message below. I'll leave out the Key box since that deals with the math behind the encryption.
The part I am stuck on right now is assigning a number to each one of the characters so that it can be encrypted. These numbers need to remain the same so that the message can be decrypted as well.
View 19 Replies
Nov 23, 2010
i have this .xml file read and display at runtime by vb.net2003. the .xml file is the database which contain various data and its not for adding more data or edited by user so i need to protect the file so that my code can read and display those data. can anyone know how to protect the file.
View 1 Replies
Feb 1, 2012
Here is some code that works well for strings:
[Code]....
modifying these functions to encrypt/decrypt byte arrays rather than strings. Also, to have the functions return the encrypted/decrypted byte array, rather than a string.
View 2 Replies
Oct 12, 2011
I am trying to implement the encryption script from Barclays payment gateway, however it's in VB and the rest of our site is in c#.
The script is
Public Class Example
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
[code]....
How am I able to either run this VB in my C# aspx page? Or do I need to convert it to use c#?? In my aspx page, I have the first line
<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="utf-8" CodeBehind="encryption.cs" %>
View 2 Replies
Jun 2, 2009
my program takes a txt file and encrypts it successfully but it returns the wrong thing when decryting.[code]
View 4 Replies
Sep 23, 2010
I have a problem with an encryption made in AdobeFlex and which I need to translate to VB.NET.The core is a AES Encryption, but I tried several ways and code and the encrypted strings weren't the same The original Flex Sourcecode is:
VB
private function encryptAES(arg1:String, arg2:String, arg3:String="aes128-cfb8", arg4:String="None"):String
{
var loc1:*=com.hurlant.util.Hex.toArray(com.hurlant.util.Hex.fromString(arg2));
[code]....
My question is how to get the code work in VB.NET
View 3 Replies
May 30, 2011
I have a problem with an MD5-hash algorythm that's acting very oddly.Here's the
vbcode
Imports System.Security.Cryptography
Imports System.Text
[code].....
View 2 Replies
Aug 10, 2009
I'm looking to use RSA Asymmetric encryption to encrypt some data. I've read this article on the forums with a similar title, but it did not answer my question. What I would like to do is use the private key of an RSA key combination to encrypt (sign?) the data and use the public key to decrypt (verify?), as per this wikipedia article . I would like to use this method because I want people to be able to read the data, but not create it themselves. I've copied the code from Peter Bromberg's article RSA Encryption in .NET Demystified , but always get an exception with the "Bad Key" message. If I use the public key for decryption, it works fine (the opposite of what I want). use the public key for encryption.
View 2 Replies
Oct 20, 2011
In my database I have a column that contains the passwords, and I use the
View 3 Replies
Aug 21, 2009
How would I be able to use my own Encryption Algorithm in my program such as encrypting text. I havn't been able to figure this out.
View 1 Replies
Aug 9, 2009
I've seen a lot of threads on the web discussing about which encryption algorithm is better.According to what I've read, AES encryption algorithm is based on Rijndael's algorithm, and the first is the one being implemented by the US's government to secure TOP SECRET files.From what I've tried RijndaelManaged only supports 128bit long keys (that would be a byte array with 16 byte values, right?) and not 256 as I had first thought; however, AES seems to support 256bit keys (or is it all the way around?), I haven't personally tried DES nor TripleDES.
So, which one is better or more secure? And what's up with asymmetrical encryption? What's the difference? Can both symmetrical and asymmetrical encryption be used for the same thing?
View 24 Replies
Sep 12, 2011
At first i thought it was the padding since mcrypt uses zero padding but i changed the php to use PKCS7 and get the same exact results.I think it has something to do with the padding in the php.Test output from .Net:
Key: d88f92e4fa27f6d45b49446c7fc76976
Text: Testing123
Encrypted: /DMkj7BL9Eu2LMxKhdGT+A==[code]......
View 2 Replies
Mar 14, 2012
Public Shared Function DESEncrypt(ByVal Data As String, ByVal Key As String) As Byte() Dim IV() As Byte = {&H12, &H34, &H56, &H78, &H90, &HAB, &HCD, &HEF}
[Code]...
this is what I currently have for my DES encryption, but as I am fairly new to VB.Net I can figure out how to make it use Triple DES rather than DES
View 1 Replies
Apr 13, 2012
I would like to read the contents of an existing Outlook 2007 PST file by VB.Net. I find already the file and record structure, this is not a problem. But I have a problem with the compressible encryption how is used. Now I have read that this encryption is based on a simple byte-substitution cipher with a fixed substitution table. But unfortunately I can't find this table. Maybe someone can help me where to find this table or where I to find all the necessary information about compressible encryption.
View 7 Replies
Dec 2, 2011
I desperately need this VB.NET code converted to PHP.This is the Instructions I received:To test your encryption, encrypt the following word with these keys and check if you get the same result:
Text to encrypt: MyPassword
Salt key: *&^%$#@!
PBE Key: FWV70700[code].....
View 1 Replies
Jun 29, 2011
encrypt MS Access database and also decrypt it.
My purpose is to encrypt the database so that it cannot be open independently without using the application. my application should still be able to access it read/write.
View 2 Replies
Apr 23, 2011
How can I enable the encryption of an WCF (Windows Communication Foundation) Service with VB.NET? Is it enough to add a certificate to a service an set <security mode=""> to "TransportWithMessageCredential"? Or is there any other settings needed?
[Code]...
View 1 Replies
Apr 23, 2011
I am not sure if there is such thing in VB.NET via 128-bit Encryption or more. [code]...
View 12 Replies
Jul 28, 2011
I am trying to encrypt a zip in VB.NET to send to an android device using Air. Then once its on the device, decrypt it using the key and IV.
Here is part of my VB.NET Code:
Private Sub EncryptBytes(ByVal fileIn As String, ByVal fileOut As String, ByVal pass As String, ByVal ivString As String)
Dim crypt As New RijndaelManaged
crypt.KeySize = 256
[Code]...
This is not working ... Note that I tried to write a PKCS7 class based on a Java class I found. The hurlant package I downloaded only had PKCS5. VB.NET did not provide any of the same padding classes as hurlant comes with. I wish I could using "None" but I couldn't get passed the error in VB.I think there may also be an issue with the way I am converting a string into a byte array in VB vs Air.
View 1 Replies
Oct 26, 2011
I wanted to know how to encrypt data.And I've found a solution at this web site.This script works if I use it as a function.Nonetheless, Visual Studio throws a warning that says the following.[code]Visual Studio underlines the second line after the equal symbol above.I have no idea what that means.Does anybody have any idea how I can resolve this warning?
View 6 Replies