This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Trying to decrypt blowfish

Old posts that have not been replied to for several years.
Locked
d
dw33p
Voice
Posts: 1
Joined: Wed Dec 22, 2004 7:07 am

Trying to decrypt blowfish

Post by dw33p »

Hej,

Im making a new script, wich should be able to use blowfisch.
The encryption part goes ok, but im having troubles with the decryption command.

Here a few code snippets

Code: Select all


#the blowfish settings
set response(USEBLOW) 1
set response(BLOWKEY) "f0rt3sting0nlyatthismoment!"
set response(BLOWHEADER) "+OK"

#the binding of incoming encrypted things
bind pub -|- [set response(BLOWHEADER)] proc_decrypt

#the decrypting proc
proc proc_decrypt { nick uhost hand chan arg } {
	global usedproc response
	
	set commandline [decrypt $response(BLOWKEY) $arg]
    set docommand [lindex $commandline 0]
    set doarg [lrange $commandline 1 end]	
	
	foreach curproc $procs {
    set curproc [split $curproc :]
    	if { $docommand == [subst [lindex $curproc 0]] } {
    		[lindex $eachproc 1] $nick $uhost $hand $chan $darg
    		return
    	}
    }
}
Afaik this should be right. I looked at other scripts using blowfish enc/decryption and it seems to work there.
But... im getting this wierd error that the proc proc_decrypt is missing an argument:

[13:55] Tcl error [proc_decrypt]: no value given for parameter "hand" to "decrypt"

Kinda wierd, caus if i remove the hand argument, it says the proc is getting called with to many arguments.
Can someone help me with this strange problem?

dw33p
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

this is in a wrong forum, but anyway:

try to get an error traceback with .set errorInfo

your proc has syntax errors, you probably meant $doarg, not $darg; also, I don't see $procs declared as global
Locked