Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Scheme Programming Language

source code obfuscator for the Scheme programming language


Hi all.

I am looking for a
source code obfuscator for the Scheme programming language
(preferably for R5RS programs).

Renaming identifiers would suffice for my purposes.
Greetings
Sven

Sven.Hartru@FernUni-Hagen.de writes:
> I am looking for a source code obfuscator for the Scheme programming
> language (preferably for R5RS programs).

I want to say it before anyone else... just re-write it in Perl.

Cheers,
Phil
--
Old people don't need companionship. They need to be isolated and
studied so it can be determined what nutrients they have that might
be extracted for our personal use.

Hi Sven,

> I am looking for a
> source code obfuscator for the Scheme programming language
> (preferably for R5RS programs).

> Renaming identifiers would suffice for my purposes.

When the PLT team were involved with the ICFP Contenst,
they used an obfuscator of sorts. I am not sure, whether
it was PLT specific or not, but it is worth a shot asking
for it at the PLT mailing list.

--
Jens Axel Sgaard

Sven Hartrumpf writes:
> Hi all.
> I am looking for a
> source code obfuscator for the Scheme programming language
> (preferably for R5RS programs).
> Renaming identifiers would suffice for my purposes.

Just coded, barely tested, inefficient, simplistic.  You would have to
extend `r5rs-keywords' for your purposes.

;; Copyright (C) 2007, Emilio C. Lopes <e@gmx.net>
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; If you have not received a copy of the GNU General Public License
;; along with this software, it can be obtained from the GNU Project's
;; World Wide Web server (http://www.gnu.org/copyleft/gpl.html), from
;; its FTP server (ftp://ftp.gnu.org/pub/gnu/GPL), by sending an eletronic
;; mail to this program's maintainer or by writting to the Free Software
;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

(define r5rs-keywords '(cons car cdr define + - * / =  <= < > >= if lambda let ...))

(define (obfuscate-symbol symbol)
  ;; this code is Scsh specific.  Just use a hash algorith available
  ;; in your implementation.
  (string->symbol (string-append "x" (number->string (md5-digest->number (md5-digest-for-string (symbol->string symbol))) 16))))

(define (obfuscate expr)
  (cond
   ((and (symbol? expr)
         (not (memq expr r5rs-keywords)))
    (obfuscate-symbol expr))
   ((pair? expr)
    (cons (obfuscate (car expr)) (obfuscate (cdr expr))))
   (else
    expr)))

(obfuscate '(define (fac n)
              (if (<= n 1)
                  1
                  (* n (fac (- n 1))))))

;; => (define (xd2467530ef7303b14c9988df20bb8ce4 x7b8b965ad4bca0e41ab51de7b31363a1) (if (<= x7b8b965ad4bca0e41ab51de7b31363a1 1) 1 (* x7b8b965ad4bca0e41ab51de7b31363a1 (xd2467530ef7303b14c9988df20bb8ce4 (- x7b8b965ad4bca0e41ab51de7b31363a1 1)))))

;; (xd2467530ef7303b14c9988df20bb8ce4 5) => 120

--
Emlio C. Lopes                            Ich leb und wei nit wie lang,
Munich, Germany                            ich stirb und wei nit wann,
                                           ich fahr und wei nit wohin,
                 (Martinus von Biberach)   mich wundert, dass ich frhlich bin!

Sven.Hartru@FernUni-Hagen.de writes:
> Hi all.

> I am looking for a
> source code obfuscator for the Scheme programming language
> (preferably for R5RS programs).

> Renaming identifiers would suffice for my purposes.

A nice exercise.  You should be careful about syntax keyword that
cannot easily be renamed in scheme.  If you wanted to, you'd have to
generate macros. Also, symbol->string may pose some difficulties.

--
__Pascal Bourguignon__
http://www.informatimago.com
http://pjb.ogamita.org

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc