There was a man of the Pharisees, named Nicodemus, a ruler of the Jews:
Note 1 at Joh 3:1: Little is known of Nicodemus, since John was the only Gospel writer to mention him. By comparing Joh 3:1 with 7:50-51, we can see that Nicodemus was a Pharisee (see note 2 at Mt 3:7) and a member of the religious governing body of the Jews known as the Sanhedrin. He was also rich, as we can see from the costly spices he brought to anoint the body of Jesus for burial (Joh 19:39).
The brief sketch that we have of his actions in John could be interpreted in at least two ways. His coming to Jesus by night may have been out of fear of his peers (Joh 9:22) or embarrassment. This would lend itself to the context where many had believed on Jesus, but He would not commit or entrust Himself to them, because He knew their hearts (Joh 2:23-25, see note 2 at Joh 2:24). Also, Joh 12:42-43 states that many of the chief rulers (the group to which Nicodemus belonged) believed on Him, but they would not confess Him, because they loved the praises of people more than the praises of God. Nicodemus' attempt at defending Jesus before the Sanhedrin and also his anointing of Jesus' body before His burial could be interpreted as deeds of a secret disciple.
However, Nicodemus' nighttime visit with Jesus could be viewed as him using wisdom to escape persecution even as Paul did (Ac 9:23-25). He did stand up for Jesus before the other rulers of the Jews in Joh 7:50-51, and this brief account does not necessarily show shame on his part. Also, Nicodemus' costly gift for Jesus' burial (worth thousands of dollars) could have been an outward action of an inward commitment. There is simply not enough evidence to make a conclusive statement.