using digest instead of hexdigest and new instantiating cipher class