Romans 8:31-39: "31 What then shall we say to these things? If God is for us, who can be against us? 32 He who did not spare his own Son but gave him up for us all, how will he not also with him graciously give us all things? 33 Who shall bring any charge against God's elect? It is God who justifies. 34 Who is to condemn? Christ Jesus is the one who died - more than that, who was raised - who is at the right hand of God, who indeed is interceding for us. 35 Who shall separate us from the love of Christ? Shall tribulation, or distress, or persecution, or famine, or nakedness, or danger, or sword? 36 As it is written, 'For your sake we are being killed all the day long; we are regarded as sheep to be slaughtered.' 37 No, in all these things we are more than conquerors through him who loved us. 38 For I am sure that neither death nor life, nor angels nor rulers, nor things present nor things to come, nor powers, 39 nor height nor depth, nor anything else in all creation, will be able to separate us from the love of God in Christ Jesus our Lord."
Isaiah 50:7-9: "7 But the Lord GOD helps me; therefore I have not been disgraced; therefore I have set my face like a flint, and I know that I shall not be put to shame. 8 He who vindicates me is near. Who will contend with me? Let us stand up together. Who is my adversary? Let him come near to me. 9 Behold, the Lord GOD helps me; who will declare me guilty? Behold, all of them will wear out like a garment; the moth will eat them up."
Psalm 118:6: "The LORD is on my side; I will not fear. What can man do to me?"
1 Peter 1:3-9: "3 Blessed be the God and Father of our Lord Jesus Christ! According to his great mercy, he has caused us to be born again to a living hope through the resurrection of Jesus Christ from the dead, 4 to an inheritance that is imperishable, undefiled, and unfading, kept in heaven for you, 5 who by God's power are being guarded through faith for a salvation ready to be revealed in the last time. 6 In this you rejoice, though now for a little while, if necessary, you have been grieved by various trials, 7 so that the tested genuineness of your faith - more precious than gold that perishes though it is tested by fire - may be found to result in praise and glory and honor at the revelation of Jesus Christ. 8 Though you have not seen him, you love him. Though you do not now see him, you believe in him and rejoice with joy that is inexpressible and filled with glory, 9 obtaining the outcome of your faith, the salvation of your souls."
+++
The text is public domain:
1 If God Himself be for me,I may a host defy;For when I pray, before meMy foes, confounded, fly.If Christ, my head and master,Befriend me from above,What foe or what disasterCan drive me from His love?2 I build on this foundation,That Jesus and his bloodAlone are my salvation,My true, eternal good.Without Him all that pleasesIs valueless on earth;The gifts I have from JesusAlone have priceless worth.3 Christ Jesus is my splendor,My sun, my light, alone;Were He not my defenderBefore God's judgement throne,I never should find favorAnd mercy in His sight,But be destroyed foreverAs darkness by the light.4 He canceled my offenses,Delivered me from death;He is the Lord who cleansesMy soul from sin through faith.In Him I can be cheerful,Courageous on my way;In Him I am not fearfulOf God's great Judgement Day.5 For no one can condemn meOr set my hope aside;Now hell no more can claim me:Its fury I deride.No sentence now reproves me,No guilt destroys my peace;For Christ, my Savior, loves meAnd shields me with His grace.6 Who clings with resolutionTo Him whom Satan hatesMust look for persecution;For him the burden waitsOf mock'ry, shame, and lossesHeaped on his blameless head;A thousand plagues and crossesWill be his daily bread.7 From me this is not hidden,Yet I am not afraid;I leave my cares, as bidden,To whom my vows were paid.Though life from me be takenAnd ev'rything I own,I trust in You unshakenAnd cleave to You alone.8 No danger, thirst, or hunger,No pain or poverty,No earthly tyrant's angerShall ever vanquish me.Though earth should break asunder,My fortress You shall be;No fire or sword or thunderShall sever You from me.9 No angel and no gladness,No throne, no pomp, no show,No love, no hate, no sadness,No pain, no depth of woe,No scheming, no contrivance,No subtle thing or greatShall draw me from Your guidanceNor from You separate.10 My heart with joy is springing;I am no longer sad.My soul is filled with singing;Your sunshine makes me glad.The sun that cheers my spiritIs Jesus Christ, my King;The heav'n I shall inheritMakes me rejoice and sing.
+++
Romans 8:31-39, Isaiah 50:7-9, and Psalm 118:6 all seem to be combined in the first verse, especially in the first two lines: "If God Himself be for me, / I may a host defy." The passage from Romans 8 seems to be the main source for the hymn, though; the intercession mentioned in verse 34 appears in the third verse ("Were He not my defender / Before God's judgement throne..."), and verses 35 and 38-39 are paraphrased and expanded upon in the hymn's eighth and ninth verses, respectively.
The passage from 1 Peter 1, especially verse 4, appears primarily in the hymn's second verse, although the following verses build upon it. The "various trials" in 1 Peter 1:6 are rendered in the hymn's sixth verse as "mock'ry, shame, and losses" and "a thousand plagues and crosses," and the "inheritance that is imperishable, undefiled, and unfading, kept in heaven for you" in 1 Peter 1:4 shows up again in the last lines of the hymn: "The heav'n I shall inherit / Makes me rejoice and sing."