[plt-scheme] RSA encryption algorithm

From: Filipe Cabecinhas (filcab at gmail.com)
Date: Sat Nov 3 13:14:05 EDT 2007

On 3 Nov, 2007, at 10:25, Cristiano Rocha wrote:

> I'm not a student at IST but yes I'm doing the TPC from IST. I'm  
> actually learning Scheme by myself and a friend of mine let me use  
> this login from his PC.
And you use his email, too?...

> But I'm having doubts in the 3rd point. I don't know how I'm  
> supposed to let Scheme now that "e" and "n" are variables used  
> previously.

Anyway, I think I may help you with something...

Why can't you "save" those variables (I'm sure you learned, by now,  
how to do that) and re-use them? Remembering the results from  
functions you called previously is quite straightforward.

Furthermore, you don't have to worry about that yet. You're doing  
bottom-up programming (if you are following that order). For now  
you'll just define a function calc-d that will receive two arguments  
(e and n) and will return something. You'll only worry about combining  
that when you need that value (and when you need that value, you'll  
also have the other two).

That course's teachers are a bit paranoid and don't let anyone that  
isn't enrolled see the problems/coursework, but I'm sure you already  
should have learned all this. They're good teachers (at least the one  
I had when I did it), but a bit paranoid. I'm "forced" to see what  
MIT, Berkeley and others have on the web instead of just going to  
those pages, and it makes it harder to help someone (and not telling  
them something we shouldn't).

But let's not rant here...

By the way... You can reply on-list. ;-)

   - Filipe Cabecinhas

Posted on the users mailing list.