The first implementation makes sense. However the second "hardened" one is completely broken, because now the cache is encrypted with the dictionary key...
> BTW, if you’re a member and haven’t tried the Kirkland (Costco’s house brand) wines, prepare to taste an $8 bottle of wine that puts every $100 bottle you’ve ever tasted to shame.