But the Midianites sold Joseph in Egypt to Phutiphar, the eunuch of Pharaoh, the chief cook. In very many places Scripture mentions chief cooks (that is, princes of the cooks) in place of masters of the army: for μαγειρεύειν in Greek means to slay. Joseph, then, was sold to the prince of the army and of the warriors, not to Petefre, as is written in the Latin, but to Phutiphar the eunuch. Here the question is asked how he is afterward said to have a wife. The Hebrews relate that Joseph was bought by this man for his exceeding beauty for a shameful service, and that after his virile parts had b...een withered by the Lord, this man was afterward chosen, according to the custom of the hierophants, for the high priesthood of Heliopolis; and that Asenath, whom Joseph afterward took as his wife, was his daughter.
Source: Hebrew Questions on Genesis