Re: RSA padding

From: Michael Amling (nospam_at_nospam.com)
Date: 12/08/03


Date: Mon, 08 Dec 2003 15:15:17 GMT

Tim Smith wrote:
> In article <br104v$4c8$1@agate.berkeley.edu>, David Wagner wrote:
>
>>>I'm curious how good or bad something like this would be with RSA:
>>
>>Well, I don't like it much, myself. It has no integrity protection,
>>and I worry about chosen-ciphertext attacks. I prefer OAEP.
>
>
> I was assuming integrity protection as part of the message, but forgot to
> specify that.
>
>
>>Out of curiosity, why do you ask about this scheme?
>
>
> It just came up while thinking about ways to try to use RSA without too much
> risk. Here's the problem I'm trying to solve:
>
> I've got two operations I need to support:
>
> 1. When a user creates a new account, send their password to the server.
>
> 2. When a user logs in, verify that they know the password.
>
> For # 2, what I've been using is this:
>
> 1. Server sends a random byte string to client. (Obtained from
> /dev/urandom on Linux, which is the only platform the server runs on).
>
> 2. Client encrypts the byte string using twofish, sends result back.
>
> 3. Server decrypts and sees if strings match.

   Have you looked at SRP? IIRC, you can implement it using just a
multi-precision library. See http://srp.stanford.edu/ or RFC 2945.
   IIRC, the SRP sign-in process also produces a shared secret as a side
effect, suitable for generating session keys.

>
> For #1, what I've been using is this:
>
> 1. Client prepends message string with length (in printf %d format) and
> a colon, pads it to 63 bytes with psuedorandom numbers using whatever
> PRNG is provided by the compiler's library, and encrypts using a 512-bit
> RSA modulus (yeah, I know it should be bigger...I'll address that in the
> revision I'm doing of this) (these are passwords for a chat system, and
> from what I've seen, ROT-13 would be good enough security considering
> how obvious most of the passwords are, so mostly I just want to make
> this better so that ages from now, if this code ever ends up getting
> reused somewhere where good security IS needed, it will be OK).

   If you were to implement SRP, the client would use this procedure to
send the verifier, not the password.
   With SRP, sniffing the traffic on the network does not give Eve
sufficient information to conduct an offline dictionary attack on the
password.

>
> 2. Server decrypts to get the password.
>
> A couple problems have arose. I have a need to write some special clients
> in Perl and Java. For Perl, some of them will be run on Windows versions of
> Perl which the people using are having trouble installing modules from CPAN
> for some reason (and I'm not being helpful for them--I tell them to switch
> to Linux where Perl works fine :-)). For Java, some of the client have to
> work on old Microsoft versions that predate the cool crypto stuff. The
> clients also all need to be able to be used as part of proprietary products,
> so I can't use GPL'ed code.
>
> So, basically, I want something I can personally implement in C++, Perl, and
> Java, not using any add-on libraries. Somewhat surprisingly, MP math seems
> to be available everywhere: GMP on the server (GPL is OK there); I've got a
> less efficient MP library in C++ I wrote years ago that is good enough for
> this that I can use in the C++ Windows client; and Java and Perl both have
> MP libraries standard. Hence, the interest in RSA.
>

--Mike Amling



Relevant Pages

  • Re: Streaming Audio Video Servers, Protocols and Clients
    ... I'd prefer a web page resident client like Macromedia ... Windows Media Player? ... where do I get these libraries? ... and receiving an audio/video stream from my cam using Ogg/Theora but I ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: XPe PXE RDP minimum config?
    ... As I also mentioned you can easily eliminate CMD related components and then you will have to launch the RDP client as the Shell, ... Common Control Libraries Version 5 ... Intel Protocol Network Address Translation ...
    (microsoft.public.windowsxp.embedded)
  • Re: XPe PXE RDP minimum config?
    ... As I also mentioned you can easily eliminate CMD related components and then you will have to launch the RDP client as the Shell, ... Common Control Libraries Version 5 ... Intel Protocol Network Address Translation ...
    (microsoft.public.windowsxp.embedded)
  • Re: Some free utilities for Java, with Hebrew support.
    ... mostly separate from the one for replacing the client library. ... Then you're a MySQL reseller, by the sounds of it, rather than a MySQL ... I.e. they might use MySQL server and client, ... competing libraries, so I'd expect to see it happen sooner or later. ...
    (comp.lang.java.programmer)
  • Re: Determining IsInRole over a VPN
    ... The SRP stuff gives you secure auth of pw without passing any ... LoginUser at the server side. ... the client and server and what auth database your using ... >>> The application is a rich client that accesses a backend over the VPN. ...
    (microsoft.public.dotnet.security)