-
-
Save raxoft/421fac2ca43dbc50617b to your computer and use it in GitHub Desktop.
# Decoder for passwords created by multiuser.library of Amiga MultiUser muFS filesystem (ACrypt() encoded, AKA AS225r2 format). | |
# Copyright (C) 2015 Patrik Rak ([email protected]) | |
# This source code is released under the MIT license. | |
def decode( password, user, base = 'A' ) | |
r = 53 | |
s = password.bytes.map{ |x| x - 'A'.ord } + [ 0 ] * 12 | |
x = [] | |
for i in 0..9 | |
t = 2 * s[ i ] - s[ i + 1 ] | |
t += r if t.odd? | |
x[ i ] = ( t / 2 ) % r | |
end | |
u = user.bytes.to_a | |
pad = true | |
9.downto(0) do |i| | |
t = u[ i ] || i | |
t = x[ i ] - t | |
t -= 'A'.ord | |
t %= r | |
if pad and t == i | |
t = nil | |
else | |
pad = false | |
while t < base.ord and t < 128 - r | |
t += r | |
end | |
t = t.chr | |
end | |
x[ i ] = t | |
end | |
x.join | |
end | |
while line = gets | |
user, password = line.split( '|' ) | |
next if password.nil? or password.empty? | |
puts user | |
puts decode( password, user, 'a' ) | |
puts decode( password, user, 'A' ) | |
puts decode( password, user, '0' ) | |
puts decode( password, user, ' ' ) | |
puts | |
end | |
# EOF # |
Yes, this script can help recover the lost password. There are two phases:
-
You need to get hold of the MultiUser password file, which is typically in
MultiUser/passwd
on the main partition of the hard drive. If you have a guest account enabled, it's trivial, you just login as guest with empty password and can get the file. Otherwise, if you remember no logins at all, you will have to get it the hard way. The easiest nowadays is perhaps to remove the disk, plug it into a linux PC and simply mount the disk using the AFFS, see https://docs.kernel.org/filesystems/affs.html, and get the file. If that is beyond your possibilities, ask some friendly Linux guy to do that for you. -
Once you have the file, it's fairly easy. All you need is a machine with Ruby installed (which comes bundled with Macs and is easy enough to install on both Linux and Windows machines). Then run my script and feed it the password file you have retrieved before, e.g.,
ruby mufs_password_decoder.rb passwd
and it will spit out the several possible versions of the password for each login. That's because decoding of some of the characters in the alphabet is ambiguous, but any combination will work and you might be eventually able to remember which one you have actually used.
Hope that helps.
I forgot all passwords for my Amiga. I am looking to recover the initial login password. Can I use this tool to recover the password, and if so, can you give an idea how? Thanks in advance!