select @tt1=1
while @tt1<=@tt0
begin
select @tt2=ascii(substring(@new,@tt1,1))^(@ttkey+@tt1)
if char(@tt2)="'"
select @tt3=@tt3+'$'
else
begin
select @tt3=@tt3+char(@tt2)
end
select @tt1=@tt1+1
end
update login set password=rtrim(ltrim(@tt3)) where lo_code=@userid