Speaking of the expression "every cloud has a silver lining," it can be traced back to the writings of John Milton in the 17th century. In his 1634 work Comus: A Mask Presented At Ludlow Castle, Milton wrote:
That he, the Supreme Good, to whom all things ill
Are but as slavish officers of vengeance,
Would send a glistering guardian, if need were
To keep my life and honour unassailed.
Was I deceived, or did a sable cloud
Turn forth her silver lining on the night?
I did not err; there does a sable cloud
Turn forth her silver lining on the night,
And casts a gleam over this tufted grove.