encryption

How to hash passwords in MySQL?

How I will make every password in my user table encrypted(md5()) except one particular row using a single query? ...

C#: Blowfish Encipher a single dword

Hello, I'm translating a C++ TCP Client into C#.The client is used to encode 4 bytes of an array using blowfish. C++ Blowfish C# Blowfish(C# NET) C++ BYTE response[6] = { 0x00, 0x80, 0x01, 0x61, 0xF8, 0x17 }; // Encrypt the last 4 bytes of the packet only(0x01,0x061,0xF8,0x17) blowfish.Encode(responce + 2, responce + 2, ...

Convert.FromBase64String()

Hello, Q1 - If character ‘C’ is saved into viewstate, then just before the page is rendered,Asp.Net serializes ‘C’(along with other data) into Base64 string. If on postback I issue the following code: protected void Page_Load(object sender, EventArgs e) { TextBox1.Text = "ABCDEF"; if (IsPostBack) { string v...

Need a simple hash in PHP

I need to create a simple hashing method for passing some data in a URL. It doesn't need to be very secure, it just shouldn't be obvious to most people. The hash needs to contains the numerical id of the sender and the id of the recipient and I should be able to decode the data after reading the appended hash. Any ideas? I'd like the h...

How can you find the polynomial for a decimated LFSR?

I know that it if you decimate the series generated by a linear feedback shift register, you get a new series and a new polynomial. For example, if you sample every fifth element in the series generated by a LFSR with polynomial x^4+x+1, you get the series generated by x^2+x+1. I can find the second polynomial (x^2+x+1) by brute force,...

Sign a file using a private key in .NET

How do I sign a file using .NET and how do I then validate that the generated key is a valid one once I read it? My goal is to have a text file with some values and a generated key. I then want to be able to check that generated key in the file to make no one has tampered with the values in the file once I sent the file to a customer. ...

What's a good two-way encryption library implemented in Python?

The authentication system for an application we're using right now uses a two-way hash that's basically little more than a glorified caesar cypher. Without going into too much detail about what's going on with it, I'd like to replace it with a more secure encryption algorithm (and it needs to be done server-side). Unfortunately, it nee...

Using AesCryptoServiceProvider in VB.NET

My problem is actually a bit more complicated than just how to use AES in VB.NET, since what I'm really trying to do is use AES in VB.NET from within a Java application across JACOB. But for now, what I need to focus on is the AES implementation itself. Here's my encryption code Public Function EncryptAES(ByVal toEncrypt As String, By...

Storing encryption keys -- best practices?

I have a web application that uses a symmetric encryption algorithm. How would you store the secret key and initialization vector? Storing as a literal in the code seems like a bad idea. How about app settings? What is the best practice here? ...

Generate a client-specific verification number for a web service

I have a web service that is outward-facing, however I need to generate a verification system to ensure that a request came from a valid client. Let's say the original web service is defined as follows: [OperationContract] public void Service.RequestMethod (string clientId, int reqNumber, string reqText) { // do stuff with the ...

A way to ask a server for some config settings by passing a public key, how to

Hi, I have an application to 'roll out' to about 20 people. Storing the DB credentials in the config file is a no no, so what id like to happen, is for each PC to send its public key to the server, then the server encrypts and sends back data to client for decryption. Are there any sort of TCP services I could run to do this that alre...

Time-sensitive message verification hash - getting a loose time value

I'm looking at generating pseudo-random one-time-passwords that are time sensitive. To send a message, the user enters their password which gets hashed together with the message. The resultant hash is sent with the message to the server for verification. The server performs the same hash and compares its value to the one provided. ve...

Recommendations for encrypting/decrypting scripts elegantly?[Now on Sourceforge]

Update2: Thanks for the input. I have implemented the algorithm and it is available for download at SourceForge. It is my first open source project so be merciful. Update: I am not sure I was clear enough or everyone responding to this understands how shells consume #! type of input. A great book to look at is Advanced Unix Program...

Client-server solution for signing and encrypting files

I'm looking for a solution to perform file encrypting and signing. This would be done on the client side, and signature check and decryption on the server side. Some details: This should work for any kind of file (the signature should be "attached" to the file, not inside it like with PDFs) At least the server side should be Java base...

SHA1 VS RSA

What are the differences between SHA1 and RSA? Are they just different algorithms or are they fundamentally(ie used for different things) different on some level. ...

Securing java runtime data on an untrusted client

I'm not even sure if this is possible, but is it feasible to secure, end-to-end runtime data on an uncontrolled client? Specifically, is there any functionality in Java to take in encrypted data, process it and send it back out encrypted, all without exposing the data in plaintext to a curious 3rd party that has full access to the clien...

What's the easiest way to encrypt a file in c#?

Beforehand : I have read indeed the other topics on SO, but I can't find an answer in them. (The others are about config-files, or a list of techniques) My question thus is very simple, though a bit subjective (I'll label it beforehand :-)) what is the easiest way.. tx! ...

Simple string encryption in .NET and Javascript

I'm developing an ASP.NET MVC application in which I want to encrypt a short string on the server, using C#, and send it to the client-side. Then on the client-side it will be decrypted through Javascript code. Any thoughts on how to implement this? Do you know of a simple encryption algorithm (doesn't have to be bullet-proof secure) ...

How to create "upgradable" encrypting class

The idea is to produce utility class , so that whenever the guys hack the best currently known algorithms and new one comes to the market the only think that the Developer would have to do is to add the NewHighTechEncryptingAlgorithm_Encryptor class and change a global application setting for NewHighTechEncryptingAlgorithm_As_String so ...

Streamline web.config connectionString encryption

Is there a way to streamline the process of encrypting the connectionstrings after you deploy a web application? Here's the backstory. We manage many .NET websites. We move them to a development server and then eventually up to the production server. But after each site is created on the development box or the server box, I have to g...