Let X be a set of order n and Y be a set of order m. An (n, m, {w 1 , w 2 })-separating hash family is a set F of N functions from X to Y such that for any X 1 , X 2 ⊆ X with X 1 ∩ X 2 = ∅, |X 1 | = w 1 and |X 2 | = w 2 , there exists an element f ∈ F such that f (X 1 ) ∩ f (X 2 ) = ∅. In this paper, we provide explicit constructions of separating hash families using algebraic curves over finite fields. In particular, applying the Garcia-Stichtenoth curves, we obtain an infinite class of explicitly constructed (n, m, {w 1 , w 2 })-separating hash families with N = O(log n) for fixed m, w 1 , and w 2 . Similar results for strong separating hash families are also obtained. As consequences of our main results, we present explicit constructions of infinite classes of frameproof codes, secure frameproof codes and identifiable parent property codes with length N = O(log n) where n is the size of the codes. In fact, all the above explicit constructions of hash families and codes provide the best asymptotic behavior achieving the bound N = O(log n), which substantially improve the results in [8,15,17] and give an answer to the fifth open problem presented in [11].