We present a Las Vegas algorithm which, for a given matrix group known to be isomorphic modulo scalars to a finite alternating or symmetric group acting on the fully deleted permutation module, produces an explicit isomorphism, with the standard permutation representation of the group. This algorithm exploits information available from the matrix representation and thereby is faster than existing 'black-box' recognition algorithms applied to these groups. In particular, it uses the fact that certain types of elements in these groups can be identified and constructed from the structure of their characteristic polynomials. The algorithm forms part of a large-scale program for computing with groups of matrices over finite fields. When combined with existing 'black-box' recognition algorithms, the results of this paper prove that any d-dimensional absolutely irreducible matrix representation of a finite alternating or symmetric group, over a finite field, can be recognised with O(d(1/2)) random group elements and O(d(1/2)) matrix multiplications, up to some logarithmic factors. (c) 2005 Elsevier Inc. All rights reserved.