Permuting Small Sized Set in Practice Imagine we have a set $S$ of $m$ elements and we wants to permutes the set elements. Thus the original position of each element should be unknown after permuting. If we define a permutation function as $\pi: \{0,1\}^n \rightarrow \{0,1\}^n$, then the set elements are permuted securely if $n\le|S|$ where $n$ is the security parameter. So to permute $S$ we do $\pi (i)=r_i$, where $i$ is the original index of an element in the set, and $r_i$ is its new index. 

However, if the set size is small ($|S|&lt; n$) it seems the only way to securely permute it is to pad it first and then permute it, that increases storage cost. 

Question: Is there any better and more cost effective way of permuting a set than the above scheme?
If you can generate uniform random numbers, you can use a variant of Fisher-Yates.

//given an array s with the elements to be permuted
for i from n-1 to 1:
    t = rand(0, i) # inclusive
    swap(s[i], s[t])