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.

cbc_functions.tcl errors upon loading.

Support & discussion of released scripts, and announcements of new releases.
Post Reply
s
stomppa
Voice
Posts: 2
Joined: Sun Jul 19, 2020 2:05 pm

cbc_functions.tcl errors upon loading.

Post by stomppa »

Currently using eggdrop v1.9.0 with tcl 8.6.

Trying to load cbc_functions.tcl from the Mircryption package and encountering the following issue. The script readme says to place their provided lib folder into the /eggdrop/lib directory, but i don't see any such directory in my current eggdrop directory.

It also says the blowfish package cannot be found but other scripts that also use blowfish have no problem loading. Perhaps I'm missing something. Any help would be greatly appreciated.
McEggdrop TCL Helper Functions - settings file loaded.
McEggdrop TCL Helper Functions v1.00.29 loaded (replyencrypt noplainreply meowreply automagicon).
Tcl error in file 'testdrop.conf':
can't find package blowfish
while executing
"package require blowfish"
(file "scripts/cbc_functions.tcl" line 14)
invoked from within
"source scripts/cbc_functions.tcl"
(file "testdrop.conf" line 1652)
* CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
contents of the .tcl below.

Code: Select all

#################################################################################
# CBC FUNCTIONS v1.0 for Mircryption 1.11+ by B0unTy © 2005
# require TCL 8.4.x+
#
# using : Blowfish Module v1.3 from sourceforge tcllib
#         Base64 Module v2.3.1 from sourceforge tcllib
#         mt_rand Module v1.0.0 from Frank Pilhofer
#
# updated nov 4, 2006 - bugfix by Ripclaw for cbc_decrypt
#
#################################################################################

#### REQUIRED PACKAGES FOR CBC FUNCTIONS ####
package require blowfish
package require base64
package require mt_rand

#### CBC ENCRYPTION FUNCTION ####
proc cbc_encrypt {key text} {
	mt::seed [expr int(rand()*1000000)]
	set iv [string range [mt::rand] end-7 end]
	set cbc [::base64::encode -maxlen 0 "$iv[::blowfish::blowfish -mode cbc -dir enc -iv $iv -key $key -- $text]"]
	return $cbc
}

#### CBC DECRYPTION FUNCTION ####
proc cbc_decrypt {key text} {
	set x [::base64::decode [string range $text 0 end]]
 	binary scan [::blowfish::blowfish -mode cbc -dir dec -iv [string range $x 0 7] -key $key -- [string range $x 8 end]] A* plain
	return "$plain"
}
User avatar
CrazyCat
Revered One
Posts: 1306
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

Did you enable blowfish in your eggdrop.conf ?
s
stomppa
Voice
Posts: 2
Joined: Sun Jul 19, 2020 2:05 pm

Post by stomppa »

yep. I seem to have solved the issue by installing the latest version to tcllib.
s
scattywatty
Voice
Posts: 2
Joined: Sun Oct 18, 2020 11:22 am

Post by scattywatty »

running eggdrop 1.8.4 and have the latest tcllib installed, not sure if it's correct in doing so, but copied the lib dir to a new lib dir under my eggdrop install, I load the script and get mt_rand module not found. any better instructions on enabling this successfully? debian 10 is OS
thanks
User avatar
CrazyCat
Revered One
Posts: 1306
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

Why did you copy the tcllib directory ? It is shared, and I don't think you compile your eggdrop with the --tcllib-dir option.
mt_rand is a part of the random package, I'm not sure this package is in tcllib, so you have to downoload this package and add it in a place the eggdrop can find it
s
scattywatty
Voice
Posts: 2
Joined: Sun Oct 18, 2020 11:22 am

Post by scattywatty »

I copied the lib dir that was in the cbc_fucntions portion of the script, not from the main tcllib directory...I believe I need to compile the eggdrop with the tcllib option as you mentioned. I'll try that and reply back. Thank you CrazyCat
i
iller
Voice
Posts: 1
Joined: Fri Jan 26, 2007 6:52 pm

Post by iller »

Copy the /lib/random from the script to /usr/lib/ then it works
Post Reply